You are currently browsing comments. If you would like to return to the full story, you can read the full entry here: “Increase Your Web Site Speed With .htaccess”.
Related posts:
- Preventing Directory Browsing with .htaccess
In the past few weeks I have written a few posts about plugins I have installed to assist with administering Technically Easy. I find it very important to perform regular... - How To Generate Web Site Traffic
There is much discussion on how to generate traffic to your Web site, but I decided to list a few points on the methods I like to use. It’s All... - Speed Up Your Web Site By Using CSS Sprites
If you own a web site or blog, chances are you have thought about how to make your pages load as fast as possible. This is an obsession with many,... - 4 WordPress Plugins to Help Protect Your Blog
If you have a WordPress blog, then you have probably thought about securing and protecting your blog. I have read about many instances where someone has lost their blog because... - How to View Your Web Site as Search Engines See It
For many who start out in web site management, they learn quickly from the experienced webmasters about search engine optimization. Such things as layout and keywords are usually discussed with...


That sounds cool, but I’ll let WP-SuperCache plug-in does the job for me (on WordPress)
@Michael: The method explained above can actually help the WP-SuperCache plugin. The WP-SuperCache plugin processes the PHP files and creates static HTML pages from them. Each time a visitor requests a page, the static HTML pages are served. The problem without using the above method, is that they the static HTML pages are sent to the browser each time.
By implementing the caching explained above, you can set an expiration time. This means that if a visitor requests the same static HTML page before it has expired on their local machine, there is no server request as the local copy is displayed. Less round-trips to the server = faster respone times.
I like to use both, as they compliment each other nicely.
Great post!!!
I will implement this directives in .htaccess.
Thanks again for the great post.
Quite some time ago I came across something similar to this. I took notice at the time but then promptly forgot about it. Thanks for the reminder. When I have some time I will experiment with the suggestions made here. Thanks.
Thanks for this great tip. I’ll be trying it on all my blogs/sites right away. There is however one thing I’ld like you to reply to (if you have time)…
If people access the site from their cache, I don’t see them in my log. How accurate is my traffic analysis then? (Depending on expiry times of course…)
Cheers
Willem Kossen
http://willemkossen.nl/b
@Willem: Chances are your HTML pages are cached only for a few minutes so they won’t usually be retrieved from the cache, unless your visitors visit the same page within a few minutes. This means that you will see the request in your server logs.
Great tips! I’ll try to implement this technique.
What will happen if I set CSS expiration date for a week and then within that time I change the theme? Thanks.
@Icon: If you change it before it expires, the browser will probably use the older cached version. One way around it is to include a version number in your files, and then reference the new version. This will cause the visitor’s browser to download the new version. Another option is to change the location of the CSS file, and depending on the theme change, it may be in another directory.
Excellent post and I’m glad I visited when I did. My blog is large-mainly due to the images I use in a lot of my posts. WP-Super Cache, for some reason, does not like my blog at all. I’m going through a clean-up, theme redesign-so what is the best method- to use .htaccess and then enable WP-Cache, which will hopefully work, or, do it the other way around?
The caching used by .htaccess is mostly useful for visitors that visit on a regular basis. By setting a time limit of say a week, if they visit any number of times in that week, then they won’t redownload the content, provided they don’t delete their cache.
WP-Super Cache affects the download speed for all visitors as the PHP files were compiled into HTML files, so there is less overhead. I use both the .htaccess and WP-Super Cache together, as .htaccess affects all content and then sets a cache timeout for the HTML files created by the plugin. I set the WP-Super Cache plugin cache timeout to 600 seconds and the same for .htaccess cache timeout.
Excellent article. I am planning to implement some of these suggestions on my site to improve my load speed. Thanks for these great suggestions.