Home » Apache » Site Performance Quick Fixes
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 WP-Ecommerce Product Downloads without checking out
I've used WP-Ecommerce for a few clients who required an online catalogue, rather than an... - Using WordPress header and footers externally
I needed to integrate a WordPress header (header.php) and footer (footer.php) into an external application.... - Shopp Alternative Google Base Feed
So you're running a Shopp, you're going to need a Google Base Feed to stand... - Using Persistent Cache in WordPress (with APC)
Ever since WordPress 2.5, the WP Cache functions haven't been persistent, so the cached objects...
Categories
- 4PSA VoIPNow (1)
- Apache (20)
- APC (1)
- Automotive (7)
- Client Sites (10)
- cPanel/WHM (22)
- CubeCart (23)
- Domains (1)
- Exchange (6)
- Geeky (32)
- General (24)
- Home (1)
- HTML, CSS, AJAX (23)
- IIS (1)
- Linux (83)
- MS SQL (4)
- Music (5)
- MySQL (19)
- nginx (5)
- Photography (17)
- PHP (102)
- phpBB (1)
- Reviews (4)
- Scalability (1)
- Search Engines (5)
- Security (8)
- Snippets (4)
- Software (4)
- Uncategorized (6)
- Vantegra (1)
- Virtualisation (1)
- VoIP (3)
- WHMCS (1)
- Windows (42)
- WordPress (74)
- Shopp (14)
- Xen (2)
Recent Comments
- MUsh on Exchange 2003, 2007 & 2010 Topology discovery failed, error 0x80040a02 (DSC_E_NO_SUITABLE_CDC)
- Thomas on WordPress Opengraph and Microdata Generation without a plugin
- thiyagi on [Snippet] Create a large file in Linux
- Gopal Aggarwal on Multiple loops or making your own loop in WP-Ecommerce
- Ashique Zakariyya on Installing nginx & PHP-FPM securely on CentOS
Kieran Barnes
Independent PHP, WordPress and CubeCart programmer and consultant in Manchester, UK.
I can offer programming and consultancy for your next WordPress, Ecommerce or PHP web application.
About Kieran
Kieran is a PHP developer with 15 years commercial experience. He has a niche for all things WordPress, CubeCart and other open sourcery. With expertise in most areas of Linux and Windows wrangling makes him a good choice for supporting and consulting your next web application.
Get in Touch
Sitemap (HTML)
Sitemap (XML)



September 12th, 2010 - 14:50
Thanks a lot!