Skip to main content

Cache TiddlyWeb ETags so that a 304 can be sent without checking store

Project description

This is a plugin for TiddlyWeb that creates a cache of ETags.

It uses the memcached handling provided by tiddlywebplugins.caching.

Cache invalidation is handled via store hooks and this trick: http://code.google.com/p/memcached/wiki/FAQ#Deleting_by_Namespace

Note the test files are not good tests, there were used to structure development but do not adequately assert anything.

The plugins keeps a cache of ETags so we don’t need to access the store to do validation.

This operates as a two tiered piece of middleware.

On the request side it checks if the request is a GET and if it includes an If-None-Match header. If it does it looks up the current URI in the cache and compares the value with what’s in the If-Match header. If they are the same we can raise a 304 right now.

On the response side, if the current request is a GET and the outgoing response has an ETag, put the current URI and ETag into the cache.

Store HOOKs are used to invalidate the cache through the management of namespaces.

Installation is simply adding the plugin name to system_plugins and twanager_plugins in tiddlywebconfig.py

Licensed as TiddlyWeb itself. Copyright 2011, Chris Dent <cdent@peermore.com>

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

tiddlywebplugins.etagcache-0.6.tar.gz (8.0 kB view details)

Uploaded Source

File details

Details for the file tiddlywebplugins.etagcache-0.6.tar.gz.

File metadata

File hashes

Hashes for tiddlywebplugins.etagcache-0.6.tar.gz
Algorithm Hash digest
SHA256 dbd6114cec4e2f3c2e9f525f015e33775300332771ea98f4c8a54a26c1749ce2
MD5 ba44e3f4bdbff54d4a6c1c1b26bcb048
BLAKE2b-256 f3d4073befdfe74ed03358507de3eeb0c2c9e145088aabc38b1bb7c6c9ced22c

See more details on using hashes here.

Provenance

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page