How to Fix Serve static assets with an efficient cache policy

Hi, I got this: Serve static assets with an efficient cache policy - 23 resources found on Page Speed Insight. If possible, I want solve this.

Could anyone help by giving me some guides?

Most of the elements are from Media Library such as local font file and image file (serve webp by Cloudways CDN).

I have gone through the Server - SETTINGS & PACKAGES - Advances - Nginx , it is already default 43200 min. So, I don’t know what to do.

Thanks for sharing.

Static assets (like images, CSS, JaveScript, fonts etc) need to have their caching headers applied separately - the Nginx configuration doesn’t have any effect on them.

I prefer to set this browser caching in the htaccess myself, but many caching plugins will apply these settings to the htaccess automatically for you as well.

Hope that helps?

Paul

Hi @paul4 Are you sure these are required? As per Cloudways blog article, these manual entries are NOT required.

Please see relevant portion below

I’m a Cloudways Customer, What’s in It for Me?
If you are a Cloudways optimized WordPress hosting customer, then you should put aside your worries about WordPress leverage browser cache warning popping up in online speed testing tools. Because Cloudways handles this issue by itself. You can change the expiry time by simply navigating to Server → Settings & Packages → Advanced, scroll down a bit and look for NGINX – Static Cache Expiry. The default value is 43200 min, that is equivalent to 30 days.

Pasted from https://www.cloudways.com/blog/optimize-wordpress-page-load-time-by-browser-cache-leverage/

The only issue I can see for font files.

For some I am unable to edit the post.

All that is required is to change default value from 43200 min to 525600 min which is 1 year

I am trying to figure why is this not working on .woff font files. It seems to be working on .woff2 font files.