Created
May 23, 2013 01:12
-
-
Save apiguy/5632134 to your computer and use it in GitHub Desktop.
Fine grained Flask-Classy cache header example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class BlogView(FlaskView): | |
cacheable_views=('index') | |
def index(self): | |
return render_template('index.html') | |
def get(self, id): | |
return render_template('get.html') | |
def after_request(self, name, request): | |
if name not in self.cacheable_views: | |
request.headers.no_cache = True | |
return request | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment