Skip to content

Instantly share code, notes, and snippets.

@apiguy
Created May 23, 2013 01:12
Show Gist options
  • Save apiguy/5632134 to your computer and use it in GitHub Desktop.
Save apiguy/5632134 to your computer and use it in GitHub Desktop.
Fine grained Flask-Classy cache header example
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