There are multiple levels at which PageSeeder utilizes caching to improve performance. This entry is specifically oriented to HTTP caching.
Cache-Control is an HTTP header value, used by both the user agent (the browser) and the server (and proxy servers), to control how the browser caches content served by PageSeeder. This can optimize performance and conserve bandwidth.
PageSeeder uses two types of cache control, depending on the type of resources being requested.
Expires: Thu, 01 Jan 1970 00:00:00 GMT Cache-Control: no-cache
Cache-Control header with a value of
no-cache prevents caching by browsers and proxies, ensuring that the user always gets a fresh copy directly from the server.
Expires header is only needed for old proxy servers which do not support HTTP/1.1
While this configuration ensures currency of resources, it is costly in terms of bandwidth and CPU and should not be used when it isn’t necessary.
Expires: Fri, 03 Jun 2011 05:02:07 GMT Cache-Control: max-age=86400, must-revalidate Etag: W/"4845-1267586931000-gzip"
Cache-Control header tells the browser that the resource can be cached for up to
86400 seconds (= 24 hours), then it must be checked for currency (revalidated).
Revalidation is done by the client returning the Etag from the original header back to the server.
Expires header is only needed for old proxy servers which do not understand HTTP/1.1, and should be overridden by the
When the PageSeeder Server re-validates a resource (and the request is successful), it returns either of these:
|200 (OK)||Including the content if the resource is new or the server is unable to determine whether the browser has a copy|
|304 (Not Modified)||Headers without the content assuming that the browser has a copy|
The browser doesn’t attempt to connect to the server while the resource is considered fresh.
See also Hypertext Transfer Protocol -- HTTP/1.1 .
Following are the different ways the browser retrieves resources. These are dependent on the action from the user.
URL in address bar
|Retrieves the resource in the most efficient manner: from cache if possible, otherwise from the server. Sends an Etag if one is available for the resource.|
|Reload or |
|Asks the server to revalidate the cached copy. This request to the server contains the HTTP header |
|This expects the browser to discard the cached resource and request a new version from the server, forcing a reload. The HTTP headers include |