• I had the issue when after Autoptimize cache flush, Cloudfront served page without CSS. This happened when the expiration of the autoptimize_md5.css was expired, however some pages were still not expired, so cloudfront served the cached page, pointing to the old autoptimize_md5.css, and when the old one wasn’t found, the page loaded without css and js.

    I approached the problem from 2 perspectives:
    – I have written a cloudfront invalidation on Autoptimize cache flush action, with the important caveat that it won’t send request to cloudfront more than once in every 5 minutes, because they charge for this (after the 1000th invalidation each month).
    – I have played with expiration times, and specifically set Autoptimize assets in wp-content/cache/autoptimize to expire after 1 month (should be at least 4 times more than the pages themselves).

    I am both sharing the experience, and asking if anyone had the same issue, and had a better solution.

  • The topic ‘Cloudfront expiration issues’ is closed to new replies.