Site Performance Quick Fixes
I've been playing around with YSlow for a while now, now I decided to a quick test on this blog.
This blog, according to YSlow rates a frumpy Grade D, with a score of 61. Not bad, but not great.
A bit of .htaccess trickery should give me a few extra points... Excellent Grade C, with a score of 73.
Here's the modified .htaccess file. Some of this is blatantly stolen borrowed from the AskApache Guru.
# Turn on Expires and set default to 0
ExpiresActive On
ExpiresDefault A0
# Set up caching on media files for 1 year (forever?)
<FilesMatch "\.(flv|ico|pdf|avi|mov|ppt|doc|mp3|wmv|wav)$">
ExpiresDefault A29030400
Header append Cache-Control "public"
</FilesMatch>
# Set up caching on media files for 1 week
<FilesMatch "\.(gif|jpg|jpeg|png|swf)$">
ExpiresDefault A604800
Header append Cache-Control "public"
</FilesMatch>
# Set up 2 Hour caching on commonly updated files
<FilesMatch "\.(xml|txt|html|js|css)$">
ExpiresDefault A7200
Header append Cache-Control "proxy-revalidate"
</FilesMatch>
# Force no caching for dynamic files
<FilesMatch "\.(php|cgi|pl|htm)$">
ExpiresActive Off
Header set Cache-Control "private, no-cache, no-store, proxy-revalidate, no-transform"
Header set Pragma "no-cache"
</FilesMatch>
# deflate JS and CSS
<IfModule mod_deflate.c>
<FilesMatch "\.(js|css)$">
SetOutputFilter DEFLATE
</FilesMatch>
</IfModule>
# Disable pesky ETags.
Header unset ETag
FileETag None
What have we done?
- Setup caching on most of the commonly served files
- Set Javascript and CSS files be GZipped
- Disabled ETags.
So, jumping up a grade for just a simple cut and paste job? Can't be bad.
What else can we do? Well, theres lots. For example, I use the LightView Plus plugin, it's very JS & CSS heavy. Disabling it adds 13 points, taking me up to a score of 86. It also saves 50k of code.
Take a look at your Wordpress plugins. Do you really need them all? Perhaps try loading the plugins only on the pages you require them on. cformsII lets you do exactly that!
Related posts:
- WP Super Cache – I’m impressed
Pictures speak better than words... WP Super Cache has shaved nearly 3 seconds off the... - Using Wordpress header and footers externally
I needed to integrate a Wordpress header (header.php) and footer (footer.php) into an external application.... - Enabling mod_deflate/gzip globally on cPanel
There's far too many reasons to mention why you should enable mod_deflate to gzip your... - WP-O-Matic Bug Fixes Round Up
I've run into quite a few issues in the latest 1.0RC3-7 release of WP-O-Matic. Here's...
What this article useful to you?
Let me know, buy me a beer!
Alternatively, if you're feeling impecunious, you may like to subscribe to my RSS feed, or see other articles in the Apache, Wordpress category.
Hi, I’m Kieran.
I'm a PHP programmer. I specalise in CubeCart, Wordpress, phpBB as well as custom projects.
I'm a techie, I work at Mesh Internet.
Categories
- Apache
- Automotive
- CentOS
- cPanel/WHM
- CubeCart
- Domains
- Exchange
- Geeky
- General
- Home
- HTML, CSS, AJAX
- Linux
- MS SQL
- MySQL
- Photography
- PHP
- phpBB
- Reviews
- Search Engines
- Snippets
- Software
- Ubuntu
- Vantegra
- Windows
- Wordpress
Lifestream
-
Graciela Miranda commented on your photo.— 9h ago via Facebook
-
Christophor Rick commented on your photo.— August 31st via Facebook
-
Vix Lucas commented on your photo.— August 30th via Facebook
-
Stuart King commented on your photo.— August 29th via Facebook
-
Stuart King and Laura Pennington ッ commented on your status.— August 29th via Facebook
-
Andy Wildcard Peglion also commented on his photo.— August 28th via Facebook
-
Michelle Sarky Symonds also commented on her photo.— August 25th via Facebook
-
Michelle Sarky Symonds also commented on her photo.— August 25th via Facebook
-
Vix Lucas commented on a photo of you.— August 25th via Facebook
-
Vix Lucas commented on a photo of you.— August 25th via Facebook
Tags
Recent Comments
- Strategerizer on Using Wordpress header and footers externally
- Recruitment Global on Bad times, I had to use a book from the monitor stand today
- Kieran on Converting XLS to CSV. Simple, eh? Well, sorta.
- Jim on Converting XLS to CSV. Simple, eh? Well, sorta.
- Harshit on Reset MySQL password on Ubuntu in about 1 second*