New on Srapsware
 

Leverage Browser Caching Apache Linux

Speedup your Website

Leverage Browser Caching Apache Linux

What Do We Mean With Leverage Browser Caching?

The most important cache mechanism for page speed is browser caching. Most of the static files that are used on web pages can be saved on the computer of your visitor for future access. Every time the visitor accesses a new page on your website these files will then be accessed from the visitor’s computer instead of your server, which will greatly speed up page load times.

Leverage Browser Caching for Apache via the .htaccess file

You can leverage browser caching for Apache servers by adding a small snippet to the .htaccess file. Below are the two recommended ways of doing this:

Mod_Expires (most commonly used option)

Add the following code to the .htaccess  file and edit the access time and file types to your liking:

Not Working?

Make sure the mod_expires  module is enabled on your server by running the following command via SSH access (or ask your host about this):

Mod_Headers (works just as well)

Add the following code to the .htaccess file. You can edit the filetypes and cache access time to your liking. Right now the access time is set to 2592000 seconds , which is 30 days.

Examples of various access times:

Not Working?

Make sure the mod_headers  module is enabled on your server by running the following command via SSH access (or ask your host about this):

You may want to know about Leverage Browser Caching for Windows Servers-IIS:

 

Leverage Browser Caching for Windows Servers-IIS

No Comments

Post A Comment

Excited? Let’s Talk

You’re Our First Priority. Rest all can wait.