Created
July 19, 2018 07:03
-
-
Save sangdongvan/31a7160ceaee8806436ec8c4f7fa4f34 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| stale_while_revalidate_seconds = settings.FRONTEND_CACHE_TIMEOUT / 2 | |
| three_days_in_seconds = 60 * 60 * 24 * 3 | |
| extra_cache_control_headers = { | |
| 'stale-while-revalidate=%s' % stale_while_revalidate_seconds, | |
| 'stale-if-error=%s' % three_days_in_seconds, | |
| } | |
| patch_cache_control(response, **extra_cache_control_headers) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment