Make it go faster – Expires Headers

apache_feather Or, Wisefaq now tells your web browser that it’s ok to cache graphics (GIF/PNG/JPG/JPEG/ICO), Javascript and CSS.

“This would be important because??”, you ask.

Well when you visit again, your web browser will use it’s copies of the graphics/Javascript/CSS, instead of downloading them again.

A win for you (speed), and me (bandwidth).

Hooray for us!

So how did I manage this?

Wisefaq sits on an Apache web server.

I told the Apache web server to tell your web browser when to check graphics/Javascript/CSS files for updates.

Before the change, your web browser would always check/download the graphics/Javascript/CSS.  Now it will wait up to a month.

So what was the change?

I modified the .htaccess file to include the following:

ExpiresActive On
ExpiresDefault A0
ExpiresByType image/gif A2592000
ExpiresByType image/png A2592000
ExpiresByType image/jpg A2592000
ExpiresByType image/jpeg A2592000
ExpiresByType image/ico A2592000
ExpiresByType text/css A604800
ExpiresByType text/javascript A86400

So now things are faster 🙂

References:
Apache.org – Module mod_expires
Tips and Tricks HQ – How to Add Far Future Expires Headers to Your WordPress Site

Bookmark and Share

Comments are closed.