How to fix this "expiration not specified" issue according to GTMatrix?

3.1k views Asked by At

I have a website WeeTech Solution. And whenever i check my website on “GT Matrix” is show me the number of issue like... • https://www.weetechsolution.com/css/content_slider_style.css (expiration not specified)

How to fix this issue?

2

There are 2 answers

0
Vel On

you have to add this code in your htaccess file.

    <IfModule mod_expires.c>
        ExpiresActive On
        ExpiresByType image/jpg "access 1 year"
        ExpiresByType image/jpeg "access 1 year"
        ExpiresByType image/gif "access 1 year"
        ExpiresByType image/png "access 1 year"
        ExpiresByType text/css "access 1 month"
        ExpiresByType text/html "access 1 month"
        ExpiresByType application/pdf "access 1 month"
        ExpiresByType text/x-javascript "access 1 month"
        ExpiresByType application/x-shockwave-flash "access 1 month"
        ExpiresByType image/x-icon "access 1 year"
        ExpiresDefault "access 1 month"
    </IfModule>
0
Rohit Verma On

If your site in html & php then you can use .htaccess file with below code and upload this .htaccess file to main root.

<IfModule mod_expires.c>
    ExpiresActive On
    ExpiresByType image/jpg "access 1 year"
    ExpiresByType image/jpeg "access 1 year"
    ExpiresByType image/gif "access 1 year"
    ExpiresByType image/png "access 1 year"
    ExpiresByType text/css "access 1 month"
    ExpiresByType text/html "access 1 month"
    ExpiresByType application/pdf "access 1 month"
    ExpiresByType text/x-javascript "access 1 month"
    ExpiresByType application/x-shockwave-flash "access 1 month"
    ExpiresByType image/x-icon "access 1 year"
    ExpiresDefault "access 1 month"
</IfModule>

If your site in .Net then yo can use staticContent inside Web.config file code given below

<staticContent>
  <clientCache cacheControlCustom="public" cacheControlMaxAge="24:00:00" cacheControlMode="UseMaxAge" />
</staticContent>