Thanks!
On Sep 27, 12:39 am, James Gardner
<ja.....@public.gmane.org> wrote:
You can edit your config/middleware.py file so the end of it looks like
this:
...
javascripts_app = StaticJavascripts()
class NoCache(object):
def __init__(self, app):
self.app = app
def __call__(self, environ, start_response):
def sr(status,headers,exc_info=None):
headers.append(
(
'Cache-Control',
'no-cache, no-store, must-revalidate'
)
)
return start_response(status,headers,exc_info)
return self.app(environ, sr)
app = NoCache(app)
app = Cascade([static_app, javascripts_app, app])
return app
If you want to force everything to be refreshed, not just the
dynamically generated pages you can wrap the whole app in the NoCache
middleware.
Or you can do it from a controller action with:
response.headers['Cache-Control']='no-cache, no-store, must-revalidate'
James
voltron wrote:
How does one generate anti-cacheing headers in Pylons?