| | #1 |
| Warrior Member Join Date: 2011
Posts: 21
Thanks: 1
Thanked 0 Times in 0 Posts
|
I heard that specifying expiration for image and css files is a good practice. But I do not understand this. I would like to know how to specify this? Adi |
| | |
| |
| | #2 |
| HyperActive Warrior Join Date: 2010
Posts: 160
Thanks: 11
Thanked 12 Times in 12 Posts
|
You can do this in your htaccess file .... # Expire images header ExpiresActive On ExpiresDefault A0 ExpiresByType image/gif A2592000 ExpiresByType image/png A2592000 ExpiresByType image/jpg A2592000 ExpiresByType image/jpeg A2592000 ExpiresByType image/ico A2592000 ExpiresByType text/css A2592000 A2592000 means 1 month in the future (60*60*24*30=2592000) |
| |
| The Following User Says Thank You to Cash Money Hosting For This Useful Post: |
| | #3 | |
| Warrior Member Join Date: 2011
Posts: 21
Thanks: 1
Thanked 0 Times in 0 Posts
|
| |
| | ||
| |
| | #4 |
| Active Warrior Join Date: 2011
Posts: 48
Thanks: 0
Thanked 1 Time in 1 Post
|
use expire active on command
|
| |
| | #5 | |
| Warrior Member Join Date: 2011
Posts: 21
Thanks: 1
Thanked 0 Times in 0 Posts
|
Internal Server Error The server encountered an internal error or misconfiguration and was unable to complete your request. Please contact the server administrator and inform them of the time the error occurred, and anything you might have done that may have caused the error. More information about this error may be available in the server error log. So what is wrong with my file? | |
| | ||
| |
| | #6 |
| copy and paste geek War Room Member Join Date: 2005 Location: Calgary
Posts: 1,571
Thanks: 149
Thanked 321 Times in 259 Posts
|
Just a guess, but from your post it sounded like you loaded his whole post into the .htaccess file. You should only add this part. Code: # Expire images header ExpiresActive On ExpiresDefault A0 ExpiresByType image/gif A2592000 ExpiresByType image/png A2592000 ExpiresByType image/jpg A2592000 ExpiresByType image/jpeg A2592000 ExpiresByType image/ico A2592000 ExpiresByType text/css A2592000 |
| | |
| |
| | #7 | |
| Warrior Member Join Date: 2011
Posts: 21
Thanks: 1
Thanked 0 Times in 0 Posts
|
| |
| | ||
| |
| | #8 |
| HyperActive Warrior Join Date: 2010
Posts: 160
Thanks: 11
Thanked 12 Times in 12 Posts
|
Your webhost probably does not have the module mod expires set.
|
| Free Affiliate Link Cloaker <-- Nuff Said
| |
| |
| | #9 |
| Warrior Member Join Date: 2011
Posts: 21
Thanks: 1
Thanked 0 Times in 0 Posts
| |
| | |
| |
| | #10 |
| DigiMix Marketing Design Join Date: 2012 Location: New York City
Posts: 9
Thanks: 0
Thanked 1 Time in 1 Post
|
My site's hosted with GoDaddy too. I'm going to try out the code and see how it works. Thanks for sharing!
|
| | |
| |
| | #11 |
| DigiMix Marketing Design Join Date: 2012 Location: New York City
Posts: 9
Thanks: 0
Thanked 1 Time in 1 Post
|
I added expire image code to my .htaccess file then ran a Google Page Speed Test and it immediately increased my page speed from 83/100 to 85/100. But it's registering that I am not setting some of the .jpg's to expire.
|
| | |
| |
| | #12 |
| FrontEnd WebDev, Designer Join Date: 2016 Location: United States
Posts: 45
Thanks: 3
Thanked 6 Times in 6 Posts
|
Hi my friend i believe you want to speedup your website dont you ![]() well adding expiry of different files on your.htaccess file is the one thing only..... if you test your website from gtmetrix or https://developers.google.com/speed/pagespeed/insights/ you will see there are tons of minifications and customization required with your website CSS, Js files, images, CDN connectivity and many more.... well here's the one solution that i have for you ![]() go with WP Rocket plugin and try any Cloud hosting ones you will see the brilliant difference of speed on your website. |
| |
| | #13 |
| Active Warrior Join Date: 2016
Posts: 34
Thanks: 1
Thanked 4 Times in 4 Posts
|
I have never actually thought about expiraton of files haha, i am glad that I stumbled on this topic. I will make sure that I try this.
|
| |
|
| Bookmarks |
| Tags |
| css, expiration, files, image |
| |