• Resolved Megunticook

    (@megunticook)


    I seem to having some problems with browser caching of CDN content that I can’t resolve. When I check the site at GT Metrix, it says “expiration not specified” for all of my CDN content (I’m on AWS using CloudFront).

    Browser caching is enabled in W3TC.

    I configured my CDN according to an AWS tutorial for WordPress that mentioned W3TC.

    I’ve tried configuring the CDN to use origin cache headers, and then while troubleshooting I also tried configuring the CDN to specify a minimum time that objects stay in the CloudFront cache regardless of Cache-Control headers. Regardless of which one I chose, GT Metrix keeps reporting a “0” for browser caching.

    I’ve gone over my W3TC browser cache settings and have all the general settings checked except brotli (I use Gzip), Prevent caching of objects after settings change, Do not process 404 errors for static objects with WordPress, and Rewrite URL structure of objects.

    Any ideas about why caching isn’t working?

    Thank you.

    • This topic was modified 5 years, 7 months ago by Megunticook.

    The page I need help with: [log in to see the link]

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter Megunticook

    (@megunticook)

    As I dig into this more I believe this may be an issue with S3 as the origin for most of the static content served by the CDN.

    I tried adding Cache-Control header to my S3 bucket with value of max-age=604800 but GT Metrix is still giving me a 0 for browser caching.

    Not finding a clear explanation of how to handle this situation. I’m sure others have dealt with this.

    Any help/advice appreciated.

    Thread Starter Megunticook

    (@megunticook)

    quick update–latest GTMetrix test now giving score of 83, so I guess there was just a time delay on my S3 changes.

    If anybody runs into this issue, be sure to read which I found helpful.

    Moving on!

    Plugin Contributor Marko Vasiljevic

    (@vmarko)

    Hello @megunticook,

    I am sorry to hear about the issue you were having and sorry for the late reply. We were testing this but failed to replicate the issue. Thank you for providing the solution and glad to know the issue is resolved.

    I’m having the same issue and this topic is far from resolved.

    Recent changes in either S3 or W3TC is putting redundant user-defined metadata (x-amz-meta-*) on files uploaded thru W3TC. Suspecting W3TC (since “user-defined”).

    No expires or cache control header is being set.

    Ref:
    https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingMetadata.html
    https://docs.aws.amazon.com/AmazonS3/latest/user-guide/add-object-metadata.html

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘browser caching issue with CDN content’ is closed to new replies.