• Resolved Megunticook

    (@megunticook)


    I’ve been using W3TC for about a month and a half now, testing at GT Metrix and tweaking the plugin to get the best results.

    One thing I’m confused about is that GT Metrix keeps giving me a big fat zero for browser caching–the report says “expiration not specified.” But when I check a specific file in the Network tab of Chrome Developer Tools, I can see both “cache-control: max-age=2592000” and “expires: access plus 30 days” in the response headers. Also seeing a 304 code, which means my browser is successfully caching the file, right?

    Is this just a bug in GT Metrix? Or do I have something misconfigured? How do I ensure visitors to site are caching these files?

    Thanks. I’ll paste the full header info. for one image file in case that’s helpful:

    Request URL: https://cdn.swansislandcompany.com/wp-content/uploads/2017/07/rare-wool-throw-335×335.jpg
    Request Method: GET
    Status Code: 304
    Remote Address: [2600:9000:21da:f600:0:dc04:fa40:93a1]:443
    Referrer Policy: no-referrer-when-downgrade
    age: 44072
    cache-control: max-age=2592000
    date: Mon, 26 Aug 2019 11:25:00 GMT
    etag: “afa710313270f917f718009b10ec85e1″
    expires: access plus 30 days
    server: AmazonS3
    status: 304
    via: 1.1 6cf3377e93378c7e591abeecafea2e6a.cloudfront.net (CloudFront)
    x-amz-cf-id: zsng5b1ZflBB45PBpqy7CZ58onZ26ukBT7fAD33_9deOenEykRAA9w==
    x-amz-cf-pop: EWR53-C1
    x-amz-meta-access-control-allow-origin: *
    x-amz-meta-content-type: image/jpeg
    x-amz-meta-last-modified: Tue, 13 Aug 2019 10:27:53 GMT
    x-amz-meta-link: <https://swansislandcompany.com/usr/share/nginx/html/wp-content/uploads/2017/07/rare-wool-throw-335×335.jpg&gt;; rel=”canonical”
    x-cache: Hit from cloudfront
    :authority: cdn.swansislandcompany.com
    :method: GET
    :path: /wp-content/uploads/2017/07/rare-wool-throw-335×335.jpg
    :scheme: https
    accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3
    accept-encoding: gzip, deflate, br
    accept-language: en-US,en;q=0.9
    cache-control: max-age=0
    cookie: _ga=GA1.2.395516380.1534482950; _gid=GA1.2.1254501317.1566779581
    if-modified-since: Mon, 19 Aug 2019 12:40:54 GMT
    if-none-match: “afa710313270f917f718009b10ec85e1”
    sec-fetch-mode: navigate
    sec-fetch-site: none
    sec-fetch-user: ?1
    upgrade-insecure-requests: 1
    user-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.100 Safari/537.36

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

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Contributor Marko Vasiljevic

    (@vmarko)

    Hello @megunticook,

    I am sorry you are having issues with Browser Cache settings but I am happy to assist you.
    In your GTmetrix report, when you hover over “What’s this mean?” under Leverage browser caching, you’ll see the following:
    “General guidelines for setting expiries:
    Truly static content (global CSS styles, logos, etc.) – access plus 1 year
    Everything else – access plus 1 week”.
    In your case, expiration is set to 30 days, which is not enough, static files like CSS&jpg should be 1 year.
    I hope this helps.

    Thread Starter Megunticook

    (@megunticook)

    OK–but why is GT Metrix flagging my image files also, which are set to 30 days? The example I gave above was from one of the many files GT Metrix listed in their report as “expiration not specified”

    I’ll try changing the expiration on CSS, logo file, etc. to access plus 1 year.

    But can I safely assume that GTMetrix is mistaken about all those images and other files? Or do I have something misconfigured?

    Thanks.

    Plugin Contributor Marko Vasiljevic

    (@vmarko)

    Hello @megunticook,

    The default Expires header lifetime: value in Performance>Browser Cache>Media & Other Files is 31536000s
    Images are also a static content which as per GtMetrix should be access plus 1 year

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘is browser caching working?’ is closed to new replies.