I just moved out from Globat to a new place, Jumpline. It is a good time to clean the house, and throw out all trashes.

Enable WP-Cache + GZIP

Although the official WP-Cache suggests to disable GZIP support, there are some hacks(1, 2) to enable it. That is quite neat.

After this optimization, the total size of front page is 247.6K, 85.1K of that is JavaScript, the built-in prototype.js takes 71.2K. We should take some actions for it.

GZIP the JavaScript and Stylesheet

dailyApps suggests to dynamically gzip the stylesheet and JavaScript to reduce the HTTP download. jotsheet goes even further, a neat method is demonstrated to consolidate all the CSS/JavaScript into one to save the HTTP request.

For normal users, the big bottleneck is the size of prototype.js, and it is most unlikely change unless major version update. So let’s gzip it first and check out the performance boost:
Using Dojo ShrinkSafe, the prototype.js is cut to 49K, not bad.

Thanks to the flexibility of VDS powered by Jumpline, I could easily add mod_deflate to Apache, and enable mod_deflate globally to all CSS and JavaScript. Check out the doc for details.


AddOutputFilterByType DEFLATE text/javascript
AddOutputFilterByType DEFLATE application/x-javascript
AddOutputFilterByType DEFLATE text/css

This helps me to save tens of kilobytes, now the gzipped-shrunk protoype.js is 14.6K only, the overall improvement is gzipped 30.2K versus original 142.0K, that is quite impressive.

Use client-side cache

mod_expires just did the right work, load the module and enable it wherever the content would not change:

ExpiresActive On
ExpiresDefault A2592000

Remove ETag

Use these directive to disable ETag globally in httpd.conf:

Header unset ETag
FileETag None

I get B(87) with cache, A(95) without cache in YSlow performance score. The next step optimization may introduce CDN service, for example, Amazon S3.

Share and Enjoy:
  • Print this article!
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks

5 Comments to “Optimize WordPress in another 4 steps”

  1. Jhon SEO SmithNo Gravatar | October 11th, 2007 at 4:34 pm

    Hey! You are right. Thanks for tis comment. I think this could help also.

  2. Jhon SEO SmithNo Gravatar | October 12th, 2007 at 4:33 am

    Hmm. I\’ve seen this before, and believe it won\’t work. Try to check this out also.

  3. Jhon SEO SmithNo Gravatar | October 12th, 2007 at 8:35 am

    Thanks for what you said. It seems I have thought the wrong way… until now. Hope this helps also.

  4. John DavenstarNo Gravatar | October 13th, 2007 at 5:38 am

    Thanks for what you said. It seems I have thought the wrong way… until now. Hope this helps also.

  5. John DavenstarNo Gravatar | October 13th, 2007 at 5:38 pm

    Maybe I won\’t see this until it happens, anyway. Maybe it\’s true. Until now I have only seen this in another related post.

Leave a Comment

This site is using OpenAvatar based on