WordPress.org

Ready to get started?Download WordPress

Forums

[Plugin: W3 Total Cache] Cloudfront and theme files - question about versions (7 posts)

  1. Dalton Rooney
    Member
    Posted 4 years ago #

    I am amazed by W3 Total Cache. What a plugin! I am hoping to roll it out on my site soon, in conjunction with a move of most of my static content to Amazon Cloudfront.

    My question: I notice that W3 Total Cache can be set up to move active theme files & minified versions of CSS and JS files to Cloudfront. How does one update a theme once it's been moved to Cloudfront?

    I know that Cloudfront's cache will expire a file after 24 hours and only then will it update the file. So, if I upload my new style.css or whatever global.js, it will be 24 hours until those changes are visible on the public site.

    The workaround seems to be to create versions of your files; for example style.v13.css. I am curious to hear if anyone is doing this, and how they manage the process. What about template files? Does hosting your theme files on Cloudfront mean that all php template changes require 24 hours to propagate?

  2. Dalton Rooney
    Member
    Posted 4 years ago #

    Never mind the part about php files, of course. I just realized how obviously wrong that was.

    My question about CSS & JS files remains the same, though.

  3. Frederick Townes
    Member
    Posted 4 years ago #

    According to the garbage collection time, minified file cache is rebuilt and automatically re-uploaded. Cloudfront is really irrelevant here as S3 is the file store and W3TC pushes files into the store. There is no need for a workaround.

  4. Dalton Rooney
    Member
    Posted 4 years ago #

    Hi Frederick,
    The issue I have is that once a file goes to S3, it then it goes into the Cloudfront cache. Those cached files are only refreshed every 24 hours, so if I don't add a version number I end up with a stale version of everything.

    Unless your plugin is giving a unique name to every minified file it uploads? I may have missed that.

    Thanks,
    Dalton

  5. Frederick Townes
    Member
    Posted 4 years ago #

    No, that's happening in the upcoming release.

  6. Dalton Rooney
    Member
    Posted 4 years ago #

    Got it! I'm looking forward to that, it will simplify my workflow a little bit.

  7. Frederick Townes
    Member
    Posted 4 years ago #

    Excellent.

Topic Closed

This topic has been closed to new replies.

About this Topic