diff options
| author | Michael Merickel <michael@merickel.org> | 2015-12-08 09:22:35 -0600 |
|---|---|---|
| committer | Michael Merickel <michael@merickel.org> | 2015-12-08 09:22:35 -0600 |
| commit | aecb4722640bc49a8e479f5eb5f332346535be8d (patch) | |
| tree | 46c06d1d6437165e9d15b0303106b8b48974f266 | |
| parent | 54d00fd7ff0fcfd19799cbffedb860d08604b83c (diff) | |
| download | pyramid-aecb4722640bc49a8e479f5eb5f332346535be8d.tar.gz pyramid-aecb4722640bc49a8e479f5eb5f332346535be8d.tar.bz2 pyramid-aecb4722640bc49a8e479f5eb5f332346535be8d.zip | |
allow disabling the cache buster
| -rw-r--r-- | pyramid/config/views.py | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/pyramid/config/views.py b/pyramid/config/views.py index 304ce2d43..1115ccffc 100644 --- a/pyramid/config/views.py +++ b/pyramid/config/views.py @@ -1982,15 +1982,16 @@ class StaticURLInfo(object): self.cache_busters = [] def generate(self, path, request, **kw): + disable_cache_buster = ( + request.registry.settings['pyramid.prevent_cachebust']) for (url, spec, route_name) in self.registrations: if path.startswith(spec): subpath = path[len(spec):] if WIN: # pragma: no cover subpath = subpath.replace('\\', '/') # windows - # translate spec into overridden spec and lookup cache buster - # to modify subpath, kw - subpath, kw = self._bust_asset_path( - request.registry, spec, subpath, kw) + if not disable_cache_buster: + subpath, kw = self._bust_asset_path( + request.registry, spec, subpath, kw) if url is None: kw['subpath'] = subpath return request.route_url(route_name, **kw) |
