Permalink
Browse files

So, that max-age fuzzing thing, not such a great idea

  • Loading branch information...
1 parent da20a53 commit cc53799a1ab8d2aff885958b02477e05848d6f9a @lmorchard lmorchard committed Apr 28, 2011
Showing with 2 additions and 8 deletions.
  1. +2 −6 apps/homesnippets/views.py
  2. +0 −1 settings.py
  3. +0 −1 settings_local.py-dist-prod
@@ -23,7 +23,6 @@
HTTP_MAX_AGE = getattr(settings, 'SNIPPET_HTTP_MAX_AGE', 1)
-HTTP_MAX_AGE_FUZZ = getattr(settings, 'SNIPPET_HTTP_MAX_AGE_FUZZ', 0.1)
DEBUG = getattr(settings, 'DEBUG', False)
@@ -69,11 +68,8 @@ def view_snippets(request, **kwargs):
max_age = 0
resp['Cache-Control'] = 'public, must-revalidate, max-age=0'
else:
- # HACK: Produce a max-age for the cache with a fuzz factor, so as to
- # help spread out any thundering herds on frontend cache expiry
- fuzz = int(HTTP_MAX_AGE * HTTP_MAX_AGE_FUZZ)
- max_age = HTTP_MAX_AGE + random.randint(-fuzz, fuzz)
- resp['Cache-Control'] = 'public, max-age=%s' % ( max_age )
+ max_age = HTTP_MAX_AGE
+ resp['Cache-Control'] = 'public, max-age=%s' % ( HTTP_MAX_AGE )
# TODO: bug 606555 - Get ACAO working with about:home?
resp['Access-Control-Allow-Origin'] = '*'
View
@@ -119,7 +119,6 @@
)
SNIPPET_HTTP_MAX_AGE = 75
-SNIPPET_HTTP_MAX_AGE_FUZZ = 0.1
SNIPPET_MODEL_CACHE_TIMEOUT = 60 * 60 * 24
CACHE_BACKEND = 'locmem://'
@@ -8,7 +8,6 @@ SESSION_COOKIE_SECURE = True
DEV = False # Set to False for production
SNIPPET_HTTP_MAX_AGE = 75
-SNIPPET_HTTP_MAX_AGE_FUZZ = 0.05
SNIPPET_MODEL_CACHE_TIMEOUT = 60 * 60 * 24
CACHE_BACKEND = 'memcached://127.0.0.1:11211/'

0 comments on commit cc53799

Please sign in to comment.