Skip to main content

Provides URLs for resources that change whenever their content changes.

Project description

five.hashedresource

While we want browsers to cache static resources such as CSS-stylesheets and JavaScript files, we also want them not to use the cached version if the files on the server have been updated. (And we don’t want to make end-users have to empty their browser cache to get the latest version. Nor explain how to do that over the phone every time.)

To make browsers update their caches of resources immediately when the resource changes, the absolute URLs of resources can now be made to contain a hash of the resource’s contents, so it will look like /++noop++12345/@@/myresource instead of /@@/myresource.

In developer mode the hash is recomputed each time the resource is asked for its URL, while in production mode the hash is computed only once, so remember to restart the server after changing resource files (else browsers will still see the old URL unchanged and use their outdated cached versions of the files).

To use this package, include its configure.zcml and use five.hashedresource.interfaces.IHashedResourceSkin or a skin that inherits from it.

CHANGES

1.1 (2009-07-30)

  • Added a hack to communicate to ZCML whether Zope2 debug-mode is on.

1.0 (2009-07-27)

  • first released version

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

five.hashedresource-1.1.tar.gz (6.5 kB view details)

Uploaded Source

File details

Details for the file five.hashedresource-1.1.tar.gz.

File metadata

File hashes

Hashes for five.hashedresource-1.1.tar.gz
Algorithm Hash digest
SHA256 a5ec3b009ae51ecc2687438204597b736d32a83fecaeccbb0e9654fc5ce241eb
MD5 eb901908e44c2e5afa8ebcbcd7bb485a
BLAKE2b-256 afa4a3dc8a72a0b65e1695681137e3eabc708bcd5aed6f78fc6f9c6958f43d63

See more details on using hashes here.

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