Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Jan A 59 posts 264 karma points
    Nov 16, 2017 @ 14:55
    Jan A
    0

    Versionhandle css and js to avoid client cache

    Often when we design umbraco sites we setup the IIS to cache the css on clients for better performance. The problem we get is when we later update the css/js file, the clients don't update their versions.

    You could extend the css file with a querystring like style.css?version=2

    I have read that this approach isn't good since this will prevent some of the clients to NEVER store a cache version.

    The suggested approach was to have the version in the url och filename instead. Like /assets/version2/style.css and handle the routing. I have used the Optimus bundle in some sites, and there made an extender to include the version in filename. The problem now is that I'm working on an old site, and don't want to install the plugin etc, just make a small update on the css.

    Is there a simple way to handle such routing, or any other easy way to update the css and js on clients?

  • Dan Diplo 1554 posts 6205 karma points MVP 5x c-trib
    Nov 16, 2017 @ 16:28
    Dan Diplo
    100

    All (modern) browsers cache by query string parameter. The only thing I've heard that might not are some really old proxy servers with caching. But these are so seldom used that I wouldn't worry about it.

    https://stackoverflow.com/questions/83990/is-it-the-filename-or-the-whole-url-used-as-a-key-in-browser-caches

Please Sign in or register to post replies

Write your reply to:

Draft