We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 4583
    • 24 Posts
    I have a 2.2.1 installation that's doing something funny:

    After I update the main css file for my website (main.css) and upload it, I cannot see the changes on the website for a few minutes (around 5 mins).

    I have tried usual stuff like:

    Refreshing the browser several times.
    Ctrl + F5 to clear the browser cache.
    Loading the website in a different browser.

    Less usual stuff:

    Clearing modx cache.
    Disabling modx cache completely & Clearing modx cache.

    Nothing works. Instead, after around 5 minutes, if I refresh the browser I can see the css changes without having to do any of the things above.
    *This happens with any/all browsers I tested, and it only happens with that installation. Other MODX installations on other servers do not do this. This installation itself did not do this a while ago, and nobody touched it since I last worked on it (a year ago maybe).

    Interesting:

    When I change something in the css file via SmartFtp I can see the changes right away in the MODX manager > files > main.css BUT I cannot see it in the www.domain.com/main.css No matter how many times I hit refresh main.css does not update (unless a few minutes pass first).


    Same thing the other way around: if I go to MODX manager > files > main.css and change something, I can see the change right away if I open the file via smartftp. However, I cannot see any changes if I open the file in any browser, no matter how many times I hit refresh, clear browser cache, clear modx cache and so on.

    This is the website http://bit.ly/L8lHef

    I'm not sure what's going on. It doesn't even seem to be a modx issue since the updates don't show even if I load the css file directly. More likely a hosting issue?




      • 28042 ☆ A M B ☆
      • 24,524 Posts
      I would suspect a caching proxy server at either your ISP or your hosting service, especially since it is only happening with HTTP requests.

      In one case, I happened to have two ISPs, and through one I would see changes immediately but through the other it would take several hours. It took numerous phone calls before I finally got hold of a technician who understood the problem and re-configured their proxy server.

      In another case, a client was traveling and called me from his hotel to make a change on the site. For the next several hours he repeatedly called and emailed to demand the changes be made. I finally had to get him to call his secretary at his home office to check the site and reassure him that from her location the changes were in fact made. The hotel had a caching proxy server, so he didn't see any changes until the following day.

      This was more than 10 years ago, and in general things have improved as ISPs and hosting companies have learned to configure their proxy servers better, and the server software itself has improved.
        Studying MODX in the desert - http://sottwell.com
        Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
        Join the Slack Community - http://modx.org
        • 4583
        • 24 Posts
        Hi Susan,

        Thank you for your reply. I have seen very few threads where you or BobRay have not helped out. And even if the other threads were not mine, it's not the first time your advice helped me with my projects, and I want to thank you for that smiley

        Turns out it was a caching issue(setting) on the server the site was hosted on.

        I used this to prevent caching, until I'm done working on the site, and it works just fine: http://www.era404.com/info/disabling-caching-with-htaccess/

        The interesting thing is...this server had always worked flawlessly and I have a ton of websites hosted on it, but for some reason the host changed the caching settings without letting us know. This probably saved them a fortune in bandwidth and I can understand it, but a notice would have been helpful.
          • 38290
          • 712 Posts
          You may want to check out cachebuster:
          http://modx.com/extras/package/cachebuster

          It uses System Settings to allow you to specify whether or not assets should be always be loaded fresh from the browser, or cached based on a site version number.
            jpdevries