summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Merickel <michael@merickel.org>2015-12-08 09:22:35 -0600
committerMichael Merickel <michael@merickel.org>2015-12-08 09:22:35 -0600
commitaecb4722640bc49a8e479f5eb5f332346535be8d (patch)
tree46c06d1d6437165e9d15b0303106b8b48974f266
parent54d00fd7ff0fcfd19799cbffedb860d08604b83c (diff)
downloadpyramid-aecb4722640bc49a8e479f5eb5f332346535be8d.tar.gz
pyramid-aecb4722640bc49a8e479f5eb5f332346535be8d.tar.bz2
pyramid-aecb4722640bc49a8e479f5eb5f332346535be8d.zip
allow disabling the cache buster
-rw-r--r--pyramid/config/views.py9
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)