[module]-all.js clear from browser cache

Hello,

(doing my first steps in Smart UI SDK)

I noticed, that after each upgrade of my Smart UI module, I need manually clear browser's cahce for new changes to become effective.

I see that CS uses additional parameter while loading .js libraries. .e.g. .../img/dmtest/bundles/dm-all.js?v=536.111.24231?1400

This parameter stays static and doesn't change after I upgrade my module to new version, so browser doesn't know that file had changed, and still uses local/cached version.

How to force the change of this parameter or there is another way of doing this properly?

Comments

  • Anybody, who can help with this?

  • You can increment the version number in the Configure Renderings page of the Core System - Feature Configuration section of the admin pages.

  • It works, but still requires a CS restart.
    Thank you!
  • When you deploy a new version of a CS module or a patch, the cache-busting parameter that you noticed on URLs of static assets will be increased automatically. The production scenarios are automated.

    If you copy a newer file to the /support directory fixing some problem during the development, you will have to bump the cache-busting parameter as Matthew described it. If you add/remove a public module to/from a Smart UI bundle, or if you modify the *-extension.json file, you will have to restart the server too.

    Details


    If you upgrade a CS module, which means deploying a newer module, which means a module with a higher version number, you have to restart the server. The cache-busting parameter that you noticed on URLs of static assets will be increased automatically.

    If you install a patch, you have to restart the server. The cache-busting parameter will be increased automatically too. Changes in module versions and patches lead to increasing the cache-busting parameter automatically.

    Replacing a file in the /support directory will not be recognised by the server. That is why you have to do something about it yourself. You could disable web cache in your development environment, but it will slow down all your work with the server. Flipping checkbox that Matthew pointed to does not need a server restart.

    When you replace a file in /support for Smart UI, flipping the checkbox may not be enough. If you modify an existing RequireJS module or add/remove a private module, it will still be enough. But if you add/remove a public module, or modify your extension registration, you will have to restart the server. The content of *.json files (bundle indexes and extension registrations) is cached on the very first access to the Smart UI page on the server and never refreshed. (Each worker thread caches the content of those files.) If you want to have those files reloaded, you will have to restart the server. It would be possible to fore-reloading the JSON files without restarting the server, but there is no such feature planned now. You could file a feature request about it.