This is an archive of an inactive wiki and cannot be modified.

Setting up proper caching on Apache

This technique gives a possible implementation for the CategoryBpCaching when using the Apache server.


Implementations Steps:

Configuration sample

This shows how the W3C Apache 1.3 servers are configured to serve content by type and by location:

# Enables the use of the expires directive
AddModule mod_expires.c
ExpiresActive on

# The W3C site is generally speaking quite often updated, so we use a 6 hours expiry by default
ExpiresDefault "access plus 6 hours"

# but most images are very rarely updated, so a 1 month expiry is good
ExpiresByType image/gif "access plus 1 month"
ExpiresByType image/svg+xml "access plus 1 month"
ExpiresByType image/png "access plus 1 month"
ExpiresByType image/jpeg "access plus 1 month"

# The dated documents in the so called TR space are unmutable, so we set a very high expiry
<Location ~ "/TR/[0-9]{4}/*">
  ExpiresDefault "access plus 1 year"

Further reading

CategoryApache CategoryStatic CategoryBpCaching

Contributions to this wiki are governed by the W3C policies for Contribution to W3C' wiki on Mobile Web.