Serve static assets with an efficient cache policy with html4

Viewed 2968

I am doing audits for my website in order to improve the performance and I am getting the following advise:

"Serve static assets with an efficient cache policy - A long cache lifetime can speed up repeat visits to your page."

I found that I have to add the following code in my header:

<meta http-equiv="Cache-control" content="public">

but the advise is still here when I am doing google speed insight.

So I tried another code I found, I added it in my .htaccess:

# 1 Month for most static assets
<filesMatch ".(css|jpg|jpeg|png|gif|js|ico)$">
Header set Cache-Control "max-age=2592000, public"
</filesMatch>

But it is not working either...

I don't know how to do it and I can't find a good solution on internet.

0 Answers
Related