Skip to content

Commit

Permalink
Decreased the default cache TTL
Browse files Browse the repository at this point in the history
  • Loading branch information
Pchelolo committed Oct 25, 2016
1 parent c1c6704 commit d316fbc
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 3 deletions.
2 changes: 2 additions & 0 deletions config.example.wikimedia.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ default_project: &default_project
cache_control: s-maxage=86400, max-age=86400
# 10 days Varnish caching, one day client-side
purged_cache_control: s-maxage=864000, max-age=86400
# Cache PDF for 5 minutes since it's not purged
pdf_cache_control: s-maxage=300, max-age=300
skip_updates: false

# A different project template, sharing configuration options.
Expand Down
2 changes: 1 addition & 1 deletion projects/wmf_default.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ paths:
options.mobileapps)}}'
- path: v1/pdf.yaml
options:
response_cache_control: '{{options.purged_cache_control}}'
response_cache_control: '{{options.pdf_cache_control}}'
/feed:
x-modules:
- path: v1/feed.js
Expand Down
2 changes: 1 addition & 1 deletion projects/wmf_wiktionary.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ paths:
host: '{{options.mobileapps.host}}'
- path: v1/pdf.yaml
options:
response_cache_control: '{{options.purged_cache_control}}'
response_cache_control: '{{options.pdf_cache_control}}'
/transform:
x-modules:
- path: v1/transform.yaml
Expand Down
2 changes: 1 addition & 1 deletion v1/pdf.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ paths:
content-disposition: 'attachment; filename={{request.params.title}}.pdf'
content-type: '{{get_pdf_from_backend.headers.content-type}}'
content-length: '{{get_pdf_from_backend.headers.content-length}}'
cache-control: '{{options.response_cache_control}}'
cache-control: '{{default(options.response_cache_control, "s-maxage=300, max-age=300")}}'
body: '{{get_pdf_from_backend.body}}'

definitions:
Expand Down

0 comments on commit d316fbc

Please sign in to comment.