Question

Google PageSpeed Lowered

Posted March 2, 2014 7.5k views
Hey guys, I'm very new to this whole unmanaged VPS thing. So please bear with me a little. In the past, my site is hosted with a managed VPS hosting company and my Google PageSpeed scores were 100/100 for both mobile and desktop. But ever since moving to DO last night, it has reduced to 77 and 83 for mobile and desktop respectively. Old server PageSpeed: http://developers.google.com/speed/pagespeed/insights/?url=http%3A%2F%2F96.30.15.156%2F~media Current PageSpeed with DO: http://developers.google.com/speed/pagespeed/insights/?url=47media.com.sg I believe the speed reduction is because of caching issue which, for the life of me, don't know how to solve even after reading the tutorial here: https://www.digitalocean.com/community/articles/how-to-configure-content-caching-using-apache-modules-on-a-vps Can some kind souls out there help, please? Thanks!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

×
7 answers
Hi,
You have to make some change sin your .htaccess file
You can check following tutorial for details.
http://gtmetrix.com/leverage-browser-caching.html

thank you
Hey Ray and Mamal,

Thanks for your replies. But I'm sorry I forgot to mention that I've already had browser caching added to my .htaccess file since day 1. However, somehow it doesn't work with DO's server. I do not know what other settings must I change. Below are the browser caching I've written to my .htaccess file:

## EXPIRES CACHING ##

AddType 'text/html; charset=UTF-8' html
# Add correct content-type for fonts
AddType application/vnd.ms-fontobject .eot
AddType font/ttf .ttf
AddType font/otf .otf
AddType font/x-woff .woff
AddType image/svg+xml .svg
ExpiresActive On
ExpiresByType image/jpg "access plus 1 year"
ExpiresByType image/jpeg "access plus 1 year"
ExpiresByType image/gif "access plus 1 year"
ExpiresByType image/png "access plus 1 year"
ExpiresByType text/css "access plus 1 month"
ExpiresByType application/pdf "access plus 1 month"
ExpiresByType text/x-javascript "access plus 1 month"
ExpiresByType application/javascript "access plus 1 month"
ExpiresByType application/x-javascript "access plus 1 month"
ExpiresByType application/x-shockwave-flash "access plus 1 month"
ExpiresByType image/x-icon "access plus 1 year"
ExpiresByType font/ttf "access plus 1 year"
ExpiresByType font/otf "access plus 1 year"
ExpiresByType font/x-woff "access plus 1 year"
ExpiresDefault "access plus 2 days"

## EXPIRES CACHING ##
Looks like the lines "" after ## EXPIRES CACHING ## and "" before ## EXPIRES CACHING ## got eaten up above.
Ah, the lines still got eaten up! I hope you guys know what I'm talking about. Let me give it a last shot. Here you go:
''
''
Looks like there's no way to put the lesser and greater than signs without them being eaten up. Anyway, here are the 2nd line (after the ## EXPIRES CACHING ## ):

IfModule mod_expires.c

and here's the 2nd last line (before ## EXPIRES CACHING ##):

/IfModule

Both lines are closed with the lesser and greater than signs.
Hey,

I managed to solve the problem. What I did was I enabled 'expires' in Apache.

Thanks, guys! :)
Submit an Answer