• upclickdigital

    (@upclickdigital)


    Hi there!

    I was asked by WP Engine to reach out to the plugin developer and ask

    “what the expired headers need to be set to eliminate this warning.
    The current default expire headers on the site are as follows:
    add_header Cache-Control “public, max-age=31536000″;”
    .

    What I’m wanting to do is optimize my performance and SEO, and one suggestion was to include expires headers, including on images.

    Rank Math Pro shows that the images still have no expires headers, even with the plugin installed and activated.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Ethan Kennedy

    (@ethankennedy)

    Unfortunately the plugin doesn’t interact with static files, so you’d need to have the headers set in another way.

    WP Engine should be able to help you set the headers, or I’d recommend something like a Page Rule at Cloudflare to set the expiry headers, and cache the content for a longer period of time.

    Thread Starter upclickdigital

    (@upclickdigital)

    Thank you for getting back to me.

    Do you have experience with WP Engine? The reason I ask is because we use their GES setup for Cloudflare, and only have Cloudflare on our end of the controls set for DNS. (hope that makes sense, basically saying we don’t have control over Cloudflare other than the DNS).

    When I asked about header expiry, it ended up coming down to this plugin, so I think WP Engine was suggesting this plugin would be able to care care of it.

    Any insight?

    Plugin Author Ethan Kennedy

    (@ethankennedy)

    Yeah, I used to work at WP Engine but have since moved on. They are unfortunately mistaken, the plugin isn’t able to alter headers on anything that isn’t rendered by WordPress directly. Since images are served by Nginx in their stack, the plugin code is not run.

    The static assets served by WP Engine should have headers set to 1 year currently, so those headers should be there currently. WP Engine sets max-age headers instead of expires headers, which take precedence over expires anyway.

    If you look at the headers on any of your images, you should see something like:
    cache-control: public, max-age=31536000 in the response headers like you see here:
    https://wpengine.com/wp-content/uploads/2020/11/WPE-Photo-YoungPeopleOnPhones-800×540-1.jpg.webp

    If the cache control headers and max-age are present, I would disregard the plugin warning since the cache will be maintained for a year. If not, I would follow up with WP Engine for possible solutions for altering headers on your static files.

    Thread Starter upclickdigital

    (@upclickdigital)

    Wonderful. Thank you so much for that information.

    Is a one-year expiry sufficient or is there a suggested age that would be better for performance and SEO?

    I also spoke to WPE again and they said the current expiry time should be fine.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Nginx Configuration Expire Headers’ is closed to new replies.