How to Speed up your website & save bandwidth with a simple apache .htaccess change

going to try this out and see if it works for my sites...thanks for the info appreciate it
 
Another good tweak thats powered by .htacess is to enable server side cacheing.

some source i cant remember said:
You need to have Apache's mod_expires on your server for this to work. If you have access to your servers config files, check if the following line is commented out in the load modules section:
LoadModule expires_module modules/mod_expires.so

In your .htaccess or preferably virtual host container insert something like this:
ExpiresActive On
ExpiresByType text/html "access plus 30 seconds"
ExpiresByType text/css "access plus 2 weeks"
ExpiresByType text/javascript "access plus 2 weeks"
ExpiresByType image/png "access plus 1 month"

Modify to your needs. For every file type you would like to cache, insert an extra statement. For my server, I don't want text/html to be cached for long, because they are dynamic anyway and I want to see how often pages are requested. I use compression for these files, but we'll talk about that later.
 
Isn't there a plugin that does this?
such as WP Super Cache ..would take care of it?
 
Isn't there a plugin that does this?
such as WP Super Cache ..would take care of it?

Yes as far as setting up a cache but not with using the zlib stuff. I use WPSuperCache and the above methods I posted with my WP blogs. Between the two its really made them faster.

-k-
 
By any chance, do you know offhand of an app or browser extension that could measure load times? I could use it just as a comparison betw diff setups. This is a nice meth, thx given. Actually had a post about page loading a while back but no response.
 
Last edited:
Yes as far as setting up a cache but not with using the zlib stuff. I use WPSuperCache and the above methods I posted with my WP blogs. Between the two its really made them faster.

-k-

actually, wpcache, wpsupercache does something completely different from my example .It doesn't touch .htaccess for server side caching. It uses do_cacheaction() and add_cacheaction() functions in php and takes is another way to implementing gzip. The originals poster uses apache which is less intensive php. Also, My example doesn't depend on php to determine cache. Both are better for large websites.

By any chance, do you know offhand of an app or browser extension that could measure load times? I could use it just as a comparison betw diff setups. This is a nice meth, thx given. Actually had a post about page loading a while back but no response.

http://websiteoptimization.com/services/analyze/

gives detailed times and suggestions.
 
Last edited:
Cool, going to try this. I have several wordpress sites and some of them load slow as shit.
 
Back
Top