We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 19975
    • 429 Posts
    I am experiencing issues when trying to edit CSS on the fly for my MODX site. I would typically make minor css edits during development and expect to see changed instantly within my browser. I am using the typical <link> method without any extras for caching installed so wouldn't expect linked CSS to be cached. The old CSS is even displayed when I review the linked CSS source code but can see changes within my FTPed file and file manager.

    Is this MODX related? Is there something within my browser (Google Chrome) or is it a server issue?

    Ps. I have used the <base> tag within my header html.

    My CSS is being uploaded to the /assests directory.
      Martin Sanders - Design & Web Development
      • 28042 ☆ A M B ☆
      • 24,524 Posts
      It's a browser issue. Browsers can be very aggressive about caching things like images, .css and .js

      On the other hand, I have had some ISPs and even some hosting providers have badly configured caching proxy servers that kept changes from being seen for several hours.
        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
        • 44195
        • 293 Posts
        If you press "Ctrl" and "F5" does it reload with the new CSS?

        A good method to prevent this is adding a version to your CSS link.
        e.g. instead of "style.css", make it "style.css?version=1.01"

        and then whenever you change your CSS, simply increment the version:
        <link href="/assets/theme/css/style.css?version=1.02" rel="stylesheet">
        


        This way the browser won't just use the cached version if a user has been to your site before.
          I'm lead developer at Digital Penguin Creative Studio in Hong Kong. https://www.digitalpenguin.hk
          Check out the MODX tutorial series on my blog at https://www.hkwebdeveloper.com