Skip to content

Commit

Permalink
Merge pull request #113 from glogiotatidis/cachebundles
Browse files Browse the repository at this point in the history
Cache bundles for a month.
  • Loading branch information
glogiotatidis committed May 27, 2015
2 parents 0455901 + 9c28132 commit cc7c93a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
4 changes: 4 additions & 0 deletions media/bundles/.htaccess
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
ExpiresActive on
ExpiresDefault "access plus 1 month"
FileETag MTime
Header set Access-Control-Allow-Origin "*"
3 changes: 2 additions & 1 deletion snippets/base/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,8 @@ def key(self):
# Key should consist of snippets that are in the bundle plus any
# properties of the client that may change the snippet code
# being sent.
key_properties = [snippet.id for snippet in self.snippets]
key_properties = ['{id}-{date}'.format(id=snippet.id, date=snippet.modified.isoformat())
for snippet in self.snippets]
key_properties.extend([
self.client.startpage_version,
self.client.locale,
Expand Down

0 comments on commit cc7c93a

Please sign in to comment.