How to setup Apache 2.2.3 to send "last modified" etc
Solution 1:
html5boilerplate.com includes a well commented .htaccess file that has many standard settings you should consider. Among them are reasonable settings for expiring the content (Expires, E-tags, ...).
Here's the documentation on mod_expires.
Solution 2:
Note that Last-Modified
headers are weak cache headers. The current preference is to use Cache-Control
headers.
Google has a good article on this.
Optimize Caching
Expires and Cache-Control: max-age. These specify the “freshness lifetime” of a resource, that is, the time period during which the browser can use the cached resource without checking to see if a new version is available from the web server. They are "strong caching headers" that apply unconditionally; that is, once they're set and the resource is downloaded, the browser will not issue any GET requests for the resource until the expiry date or maximum age is reached.
Last-Modified and ETag. These specify some characteristic about the resource that the browser checks to determine if the files are the same. In the Last-Modified header, this is always a date. In the ETag header, this can be any value that uniquely identifies a resource (file versions or content hashes are typical). Last-Modified is a "weak" caching header in that the browser applies a heuristic to determine whether to fetch the item from cache or not. (The heuristics are different among different browsers.) However, these headers allow the browser to efficiently update its cached resources by issuing conditional GET requests when the user explicitly reloads the page. Conditional GETs don't return the full response unless the resource has changed at the server, and thus have lower latency than full GETs.
I recommend using either Cache-Control
or Expires
headers as needed since they are strong cache headers. Some systems will ignore Last-Modified dates.
You can then use a tool like curl
or http://redbot.org to check the headers.