Login

Tag "cache_page"

Snippet List

A wrapper around cache_page making it optional

Make `cache_page` optional, depending on the result of a callable. Uncomment the added lines if you want to make sure that the consumers don't know the page is cached – that means more hits on your end, but also a guarantee that they will always get the newest data asap.

  • cache
  • caching
  • cache_page
Read More

cache_page that does nothing

When debugging/developing you want to be able to refresh your views every time you make a little change. But when in production mode you might want to cache these views because they contain long and resource hungry calculations or something. By putting this above "hack" in after importing `cache_page` you only cache the views in production mode.

  • cache
  • decorator
  • cache_page
Read More

2 snippets posted so far.