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.
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?
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.
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.