Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

Introduction

TemplateCacheManager is designed to speed up access to content views while at the same time making sure that stale content is not served up. TemplateCacheManager is derived from PageCacheManager.

Differences beetween TemplateCacheManager and PageCacheManager

TemplateCacheManager

  • is independent of the CacheSetup product.

  • returns also the ETag to the clients, supports therefore cascading and and multiple ETag caching. Client, Proxy (e.g. Squid) and TemplateCacheManager can therefore cache individual views of content including header information.

  • generates statistic reports

Installation

TemplateCacheManager is designed specifically for caching views of content objects. Unlike RAMCacheManager, TemplateCacheManager caches both the html generated by a view as well as the HTTP headers.

TemplateCacheManager builds upon Zope’s standard cache manager machinery. As with RAMCacheManager, you associate some page templates with the cache manager and configure the properties. TemplateCacheManager requires an extra step: content to be cached must generate an ETag via a caching policy. TemplateCacheManager looks for a CachingPolicyManager with id caching_policy_manager. If it finds it, it then gets an ETag for the current template + content object combination. This ETag is then used as the index into the cache. If you don’t have an ETag generated for your content, your pages will not be cached.

If you create an ETag that changes when the content is changed, then the content served up by the cache will stay fresh. There will be a cache miss the first time the page is hit after the ETag changes, then subsequent hits to the newly modified content view will reflect the new version. If your content view is personalized, you will want your ETag to vary depending on the current user. A good ETag with these properties is as follows (s. INSTALL.txt in examples directory):

ETag = id of currently authenticated user + delimiter + last modified time

for content + delimiter + current time rounded to the nearest hour

The use of the id in the ETag means that every user’s view of a content object will have a different ETag, so everybody will get different cached objects. The use of the modification time means that every time the content object changes, it will generate different ETags and hence will result in new copies being pulled from the cache. The use of the current time rounded to the nearest hour means that nothing will be served up by the cache for more than an hour.

Added bonus:

TemplateCacheManager handles conditional GETs be configured by CachingPolicyManager. If the incoming request has an If-None-Match header with an ETag that matches the content object’s current ETag, TemplateCacheManager will set a status 304 header (Not Modified) and will only return the matching ETag instead of the content. This feature is needed if you are using a proxy with ETag support (e.g. squid), which can cache and handle multiple views of content indexed by ETag and Vary header.

Information about ETags

Basic info:

http://devel.squid-cache.org/etag/etag-header.html

Multiple ETag bug of squid 2.x (patch included):

http://www.squid-cache.org/bugs/show_bug.cgi?id=2112 http://www.squid-cache.org/bugs/attachment.cgi?id=1504

Fri, 04 Jul 2008 23:46:54 +0200 Configuration example added (s. examples/INSTALL.txt)

Metadata

Release files for Products.TemplateCacheManager 0.1dev-r67896

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for Products.TemplateCacheManager 0.1dev-r67896
File Size Uploaded Provenance
Products.TemplateCacheManager-0.1dev-r67896.tar.gz 15.1 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for Products.TemplateCacheManager 0.1dev-r67896
File Interpreter ABI Platform
Products.TemplateCacheManager-0.1dev_r67896-py2.4.egg Legacy Egg format - - Details

Total release size: 42.9 kB

Release files / Products.TemplateCacheManager-0.1dev-r67896.tar.gz

Download URL Products.TemplateCacheManager-0.1dev-r67896.tar.gz
Size 15.1 kB
Tags Source
SHA-256 checksum
How to use checksums
ceac82ab57604f3407c349d5b4c1d61a91b8a7d183791b6199d3597e3f7ae115
BLAKE2b-256 checksum
How to use checksums
de5e0078162079523be8903fd0eee0b946c51b8d812fe4f46f947f6cf87c331b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / Products.TemplateCacheManager-0.1dev_r67896-py2.4.egg

Download URL Products.TemplateCacheManager-0.1dev_r67896-py2.4.egg
Size 27.8 kB
Tags Egg
SHA-256 checksum
How to use checksums
6cf7e9f1832548cfd89380230cd6b89a5261bac6771abdefb1bedc90ddfc8448
BLAKE2b-256 checksum
How to use checksums
6f759519fbb1e1c136cdde1916dde186d0dd0d9b7bcc0f3cab0ef2e6be687c9d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for Products.TemplateCacheManager 0.1dev-r67896

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page