If you’d like me to review your website and test it using Google’s PageSpeed tool, just drop me an email.
a. Compressed files (style sheets, scripts, images)
I recently found this nifty tool from Google called Pagespeed Insights - link:
https://developers.google.com/speed/pagespeed/insights/
This is a free tool that helps you with diagnosing slowly-loading pages. If you’ve got images that need optimizing, it will tell you. If your hosting server isn’t responding quickly, it will tell you. If various settings like caching are not being utilized, it will tell you.
One of the best things I’ve seen it do is it will generate a ZIP file containing your site’s images, CSS style sheets, and JavaScript files after Google automatically compresses them.
b. HTACCESS & Caching
After going through Google’s suggestions for optimizing my site, it still didn’t seem fast enough. My site doesn’t get hundreds of visitors per day, so I kept searching. I found the following .htaccess file snippet on the Joomla Magazine website. I did some quick before & after testing using Google’s Pagespeed Insights tool after adding this code to my site and my score went up by 10 points. This code made my site seem snappy. Win!
########## Begin - ETag Optimization
## This rule will create an ETag for files based only on the modification
## timestamp and their size. This works wonders if you are using rsync'ed
## servers, where the inode number of identical files differs.
## Note: It may cause problems on your server and you may need to remove it
FileETag MTime Size
########## End - ETag Optimization
########## Begin - Automatic compression of resources
# Compress text, html, javascript, css, xml, kudos to Komra.de
# May kill access to your site for old versions of Internet Explorer
# The server needs to be compiled with mod_deflate otherwise it will send HTTP 500 Error.
# mod_deflate is not available on Apache 1.x series. Can only be used with Apache 2.x server.
# AddOutputFilterByType is now deprecated by Apache. Use mod_filter in the future.
AddOutputFilterByType DEFLATE text/plain text/html text/xml text/css application/xml application/xhtml+xml application/rss+xml application/javascript application/x-javascript
########## Begin - Optimal default expiration time
## Note: this might cause problems and you might have to comment it out by
## placing a hash in front of this section's lines
<IfModule mod_expires.c>
# Enable expiration control
ExpiresActive On
# Default expiration: 1 hour after request
ExpiresDefault "now plus 1 hour"
# CSS and JS expiration: 1 week after request
ExpiresByType text/css "now plus 1 week"
ExpiresByType application/javascript "now plus 1 week"
ExpiresByType application/x-javascript "now plus 1 week"
# Image files expiration: 1 month after request
ExpiresByType image/bmp "now plus 1 month"
ExpiresByType image/gif "now plus 1 month"
ExpiresByType image/jpeg "now plus 1 month"
ExpiresByType image/jp2 "now plus 1 month"
ExpiresByType image/pipeg "now plus 1 month"
ExpiresByType image/png "now plus 1 month"
ExpiresByType image/svg+xml "now plus 1 month"
ExpiresByType image/tiff "now plus 1 month"
ExpiresByType image/vnd.microsoft.icon "now plus 1 month"
ExpiresByType image/x-icon "now plus 1 month"
ExpiresByType image/ico "now plus 1 month"
ExpiresByType image/icon "now plus 1 month"
ExpiresByType text/ico "now plus 1 month"
ExpiresByType application/ico "now plus 1 month"
ExpiresByType image/vnd.wap.wbmp "now plus 1 month"
ExpiresByType application/vnd.wap.wbxml "now plus 1 month"
ExpiresByType application/smil "now plus 1 month"
# Audio files expiration: 1 month after request
ExpiresByType audio/basic "now plus 1 month"
ExpiresByType audio/mid "now plus 1 month"
ExpiresByType audio/midi "now plus 1 month"
ExpiresByType audio/mpeg "now plus 1 month"
ExpiresByType audio/x-aiff "now plus 1 month"
ExpiresByType audio/x-mpegurl "now plus 1 month"
ExpiresByType audio/x-pn-realaudio "now plus 1 month"
ExpiresByType audio/x-wav "now plus 1 month"
# Movie files expiration: 1 month after request
ExpiresByType application/x-shockwave-flash "now plus 1 month"
ExpiresByType x-world/x-vrml "now plus 1 month"
ExpiresByType video/x-msvideo "now plus 1 month"
ExpiresByType video/mpeg "now plus 1 month"
ExpiresByType video/mp4 "now plus 1 month"
ExpiresByType video/quicktime "now plus 1 month"
ExpiresByType video/x-la-asf "now plus 1 month"
ExpiresByType video/x-ms-asf "now plus 1 month"
</IfModule>
########## End - Optimal expiration time
########## End - Automatic compression of resources
c. VPS / Dedicated Hosting
The above points are all achievable using standard, inexpensive, “shared” hosting plans. They are suitable for low traffic sites. They could even allow your low-to-medium traffic site to remain on a shared hosting plan, meaning you don’t need to upgrade to a VPS or dedicated server. In the event that your site does have a high amount of traffic, or if the above steps aren’t sufficient in speeding up your site, an upgrade to a beefier hosting plan may be in order. My suggestion is to try accessing your site from a variety of locations (e.g. your neighbor’s house, the coffee shop in town, etc) before upgrading, this way you’re certain that it’s not a connection issue that needs to be addressed between your home or office and your ISP (e.g. Comcast, Verizon, Time Warner, Google Fiber).