Merge ~cjwatson/launchpad:charm-assets-apidoc-caching into launchpad:master

Proposed by Colin Watson
Status: Merged
Approved by: Colin Watson
Approved revision: 8c1f4326a35bdf9629414288006dbc2248b2b3a8
Merge reported by: Otto Co-Pilot
Merged at revision: not available
Proposed branch: ~cjwatson/launchpad:charm-assets-apidoc-caching
Merge into: launchpad:master
Diff against target: 12 lines (+0/-1)
1 file modified
charm/launchpad-assets/templates/vhost.conf.j2 (+0/-1)
Reviewer Review Type Date Requested Status
Jürgen Gmach Approve
Review via email: mp+445292@code.launchpad.net

Commit message

charm: Don't set Cache-Control header on +apidoc

Description of the change

This location is used to serve machine-readable API documentation used by `lazr.restfulclient`, and if it sees a response with `Cache-Control: public,max-age=5184000` then it won't refresh its cache until `max-age` has passed - 60 days! This is OK for URLs whose contents change very rarely, but for machine-readable API documentation we want changes to be effective more or less immediately, and they aren't otherwise hit often enough to need such aggressive caching.

(On production, https://launchpad.net/+apidoc/ and https://api.launchpad.net/ previously had different caching configuration for the same documentation. This brings the former into line with the latter, since they're now routed to the same backend, or at least will be once we revert an emergency frontend patch - but I think that's OK.)

To post a comment you must log in.
Revision history for this message
Jürgen Gmach (jugmac00) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/charm/launchpad-assets/templates/vhost.conf.j2 b/charm/launchpad-assets/templates/vhost.conf.j2
2index 7d427d7..088afe7 100644
3--- a/charm/launchpad-assets/templates/vhost.conf.j2
4+++ b/charm/launchpad-assets/templates/vhost.conf.j2
5@@ -10,7 +10,6 @@
6 AddType application/vnd.sun.wadl+xml;qs=0.9 .wadl
7 AddType application/vd.sun.wadl+xml;qs=0.8 .brokenwadl
8 AddType application/json;qs=0.9 .json
9- Header set Cache-Control "public,max-age=5184000"
10 Require all granted
11 </Location>
12 Alias "/+apidoc/" "{{ payloads_dir }}/{{ build_label }}/lib/canonical/launchpad/apidoc/"

Subscribers

People subscribed via source and target branches

to status/vote changes: