Jump to content

Expire Type for image without extension (Apache-Htaccess)


jhd

Recommended Posts

Hello,

 

In Themeconfigurator when I added a image in a hook (top,left,right,footer) the name is converted to some similar to this:

 

wake.png

 

To

 

23672e1105f049c8b801b29e639038c508d42d60_wakepng

 

Therefore GTmetrix displays recommendations

 

Add Expires headers

F (0)
25%

Server High

 

Leverage browser caching

C (73)
58%

Server High

The following cacheable resources have a short freshness lifetime. Specify an expiration at least one week in the future for the following resources:

 

Is there any ExpiresByType for a file with no extension?

 

Best regards

Link to comment
Share on other sites

Hello Nemo1,

 

I had tried that:

ExpiresDefault "access plus 1 month"

But does not work and down PageSpeed ​​Grade.

 

 

I added this line:

        
ExpiresByType image/jpg "access plus 1 month"
after
       
ExpiresByType image/jpeg "access plus 1 month"
 
Because I was the same with images with jpg extension (not jpeg)
 
<IfModule mod_expires.c>
        ExpiresActive On
        ExpiresByType image/gif "access plus 1 month"
        ExpiresByType image/jpeg "access plus 1 month"
        ExpiresByType image/jpg "access plus 1 month"
        ExpiresByType image/png "access plus 1 month"
        ExpiresByType text/css "access plus 1 week"
        ExpiresByType text/javascript "access plus 1 week"
        ExpiresByType application/javascript "access plus 1 week"
        ExpiresByType application/x-javascript "access plus 1 week"
        ExpiresByType image/x-icon "access plus 1 year"
        ExpiresByType image/svg+xml "access plus 1 year"
        ExpiresByType image/vnd.microsoft.icon "access plus 1 year"
        ExpiresByType application/font-woff "access plus 1 year"
        ExpiresByType application/x-font-woff "access plus 1 year"
        ExpiresByType application/vnd.ms-fontobject "access plus 1 year"
        ExpiresByType font/opentype "access plus 1 year"
        ExpiresByType font/ttf "access plus 1 year"
        ExpiresByType font/otf "access plus 1 year"
        ExpiresByType application/x-font-ttf "access plus 1 year"
        ExpiresByType application/x-font-otf "access plus 1 year"
</IfModule>
 
 
Link to comment
Share on other sites

×
×
  • Create New...