Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(505)

Unified Diff: scripts/redirector.py

Issue 22898006: In the dev server, files are not cached (Closed) Base URL: https://github.com/dart-lang/dartdoc-viewer.git@master
Patch Set: Fixed bad python string style Created 7 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: scripts/redirector.py
diff --git a/scripts/redirector.py b/scripts/redirector.py
index 2f361dac7eada1f39fe307d1ea08a3b93686c25b..431ce1aace71604a9170d331fc8a028ef40660e9 100644
--- a/scripts/redirector.py
+++ b/scripts/redirector.py
@@ -42,7 +42,8 @@ class RequestHandler(blobstore_handlers.BlobstoreDownloadHandler):
path = LOCAL_PATH + self.request.path[len('docs/'):]
with open(path, 'r') as file:
result = file.read()
- self.HandleCacheAge(path)
+ # The cache age should be zero seconds if being run locally.
+ self.response.headers['Cache-Control'] = 'max-age=%d,s-maxage=%d' % (0, 0)
self.response.out.write(result)
def GetGoogleStorage(self):
@@ -64,8 +65,8 @@ class RequestHandler(blobstore_handlers.BlobstoreDownloadHandler):
age = ONE_WEEK
else:
age = ONE_HOUR
- self.response.headers['Cache-Control'] = 'max-age=' + \
- str(age) + ',s-maxage=' + str(age)
+ self.response.headers['Cache-Control'] = 'max-age=%d,s-maxage=%d' % \
+ (age, age)
application = WSGIApplication(
[
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698