This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (pypi.python.org).
Help us improve Python packaging - Donate today!
Project Description
# Pyramid Cachebust
Bust cache on static assets via query string params.

## Installation
Via pip:

pip install pyramid_cachebust

## Setup
Add to your configurator via the `include` method:

config = Configurator()
config.include('pyramid_cachebust')
config.add_static_view('static', 'myapp:static')

Now `pyramid.request.Request` has two new methods: `cachebusted_path` and `cachebusted_url`. These methods are wrappers for `request.static_path` and `request.static_url`, with the addition of tagging on cache-busting query parameters:

request.cachebusted_path('myapp:static/file.css')
>>> '/static/file.css?_=394a82fdd72eed3ac45d113bd8af554e'

request.cachebusted_url('myapp:static/file.css')
>>> 'http://localhost/static/file.css?_=394a82fdd72eed3ac45d113bd8af554e'

The querystring gets generated in one of two ways. The default is an MD5 hexdigest of the file contents. The two alternatives are the file's mtime ('mtime') or the time of app init ('init'). Generation of the hash/lookup of the mtime happens once per asset. Results are cached and served upon resultant calls.

## Configuration
To place in your Pyramid `.ini`:

| name | type | default | description
|-------------------------|---------|-----------|-------------
| cachebust.enabled | bool | true | toggles plugin on/off
| cachebust.reload_files | bool | false | when true, cache is ignored and query param is calculated on every request
| cachebust.method | str | md5 | method of file calculation (md5, mtime or init)
| cachebust.param_key | str | _ | key of query param

## Contributors
Thanks for your contributions:
* Richard Maisano (maisano)
* Marius Gedminas (mgedmin)
Release History

Release History

0.1.1

This version

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.1

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

Download Files

Download Files

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

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
pyramid_cachebust-0.1.1.tar.gz (4.2 kB) Copy SHA256 Checksum SHA256 Source Jan 15, 2015

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting