We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 436 ☆ A M B ☆
    • 265 Posts
    This might have been solved before, but at the moment I can only find a solution for MODX Evo: http://deniskomlev.com/blog/modx-evo-css-versioning

    What I'm trying to achieve is setting an expiry date or max age to the end of CSS files (or other files such as JS or images) to utilise browser caching, for example:
    /assets/css/styles.css?v=2013-27-10
    


    Ideally, it would be best if I could grab the timestamp of whenever the cache was last cleared, this usually means a document was saved and changes were made to the system. If the previously downloaded files on the local disk's timestamp are different from the current version then the newer version is downloaded, if not then it uses the local cached version.

    anyone have any ideas how this can be easily achieved using MODX?
      MODX Ambassador for Thailand. Managing Director at Monogon, a web design and development studio based in Bangkok, Thailand. - Follow me on Twitter.
      • 28042 ☆ A M B ☆
      • 24,524 Posts
      A similar snippet should work for Revo, just change the location of the cache to Revo's cache location. There is a System Event, OnCacheUpdate, so you should be able to use a plugin to set your cacheStamp value when the cache is cleared.
        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
        • 39131
        • 84 Posts
        I asked the developer of the plugin.

        His answer was:

        "No, unfortunately Revo has different plugin structure so this one will be incompatible."