Skip to main content
Code format .htaccess example
Source Link
Stephen Ostermiller
  • 99.4k
  • 18
  • 141
  • 364

Your screen shot has nothing to do with "cache from image short lifetime". The warning from google is about HTTPS. You should get an SSL certificate, which can be free or paid, from your hosting or third party.

When it comes to "cache from image short lifetime", what you could do, in case you have access to .htaccess file (usually placed in root directory) add something like this to it:

EXPIRES CACHING

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"

<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>

ExpiresDefault "access 1 month"

EXPIRES CACHING

enter image description here

Your screen shot has nothing to do with "cache from image short lifetime". The warning from google is about HTTPS. You should get an SSL certificate, which can be free or paid, from your hosting or third party.

When it comes to "cache from image short lifetime", what you could do, in case you have access to .htaccess file (usually placed in root directory) add something like this to it:

EXPIRES CACHING

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"

EXPIRES CACHING

enter image description here

Your screen shot has nothing to do with "cache from image short lifetime". The warning from google is about HTTPS. You should get an SSL certificate, which can be free or paid, from your hosting or third party.

When it comes to "cache from image short lifetime", what you could do, in case you have access to .htaccess file (usually placed in root directory) add something like this to it:

EXPIRES CACHING

<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>

EXPIRES CACHING

enter image description here

added 87 characters in body
Source Link
Mnea
  • 335
  • 1
  • 8

Your screen shot has nothing to do with "cache from image short lifetime". The warning from google is about HTTPS. You should get an SSL certificate, which can be free or paid, from your hosting or third party.

When it comes to "cache from image short lifetime", what you could do, in case you have access to .htaccess file (usually placed in root directory) add something like this to it:

EXPIRES CACHING

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"

EXPIRES CACHING

enter image description here

Your screen shot has nothing to do with "cache from image short lifetime". The warning from google is about HTTPS. You should get an SSL certificate, which can be free or paid, from your hosting or third party.

When it comes to "cache from image short lifetime", what you could do, in case you have access to .htaccess file (usually placed in root directory) add something like this to it:

EXPIRES CACHING

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"

EXPIRES CACHING

Your screen shot has nothing to do with "cache from image short lifetime". The warning from google is about HTTPS. You should get an SSL certificate, which can be free or paid, from your hosting or third party.

When it comes to "cache from image short lifetime", what you could do, in case you have access to .htaccess file (usually placed in root directory) add something like this to it:

EXPIRES CACHING

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"

EXPIRES CACHING

enter image description here

Source Link
Mnea
  • 335
  • 1
  • 8

Your screen shot has nothing to do with "cache from image short lifetime". The warning from google is about HTTPS. You should get an SSL certificate, which can be free or paid, from your hosting or third party.

When it comes to "cache from image short lifetime", what you could do, in case you have access to .htaccess file (usually placed in root directory) add something like this to it:

EXPIRES CACHING

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"

EXPIRES CACHING