Failed to solve the errors indicated by Google developers pagespeed cache

1

I am working on a web page and it is already uploaded to the hosting (but since I have to fix some things still, I have closed the access). The issue is that I opened it a moment to see what google used to tell me in its tools for uploading a web, and I have made some mistakes that I have not been able to solve. It's the first time I've done a web project.

This is one of the mistakes he gives me but the truth is that I had never heard of it and although I have read information about it, I do not understand how to fix it: (

  

Specify browser cache   Setting an expiration date or a maximum age in the HTTP headers of static resources tells the browser to load previously downloaded resources from the local disk instead of through the network.

Thank you very much for the help:)

    
asked by Dianne 28.05.2016 в 21:48
source

2 answers

2

Specifying the cache is basically telling the browser how long it should keep the files (css, images, javascript, etc.) stored in its cache before being deleted or updated.

You must create or edit the .htaccess file with content similar to the following

<IfModule mod_expires.c>
ExpiresActive On
ExpiresDefault "access plus 10 days"
ExpiresByType text/css "access plus 1 week"
ExpiresByType text/plain "access plus 1 week"
ExpiresByType image/gif "access plus 1 month"
ExpiresByType image/png "access plus 1 month"
ExpiresByType image/jpeg "access plus 1 month"
ExpiresByType image/x-icon "access plus 3 months"
ExpiresByType application/x-javascript "access plus 1 month"
ExpiresByType application/javascript "access plus 1 week"
ExpiresByType text/javascript "access plus 1 week"
ExpiresByType application/x-icon "access plus 3 months"
</IfModule>

You can specify days (Days), months (Months) and years (Years).

    
answered by 28.05.2016 / 21:57
source
0

This site is recommended for the solution of each item of Google: link , this topic is a science.

    
answered by 31.05.2016 в 05:35