launchpad-reviewers team mailing list archive
-
launchpad-reviewers team
-
Mailing list archive
-
Message #30162
[Merge] ~cjwatson/launchpad:charm-assets-apidoc-caching into launchpad:master
Colin Watson has proposed merging ~cjwatson/launchpad:charm-assets-apidoc-caching into launchpad:master.
Commit message:
charm: Don't set Cache-Control header on +apidoc
Requested reviews:
Launchpad code reviewers (launchpad-reviewers)
For more details, see:
https://code.launchpad.net/~cjwatson/launchpad/+git/launchpad/+merge/445292
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.)
--
Your team Launchpad code reviewers is requested to review the proposed merge of ~cjwatson/launchpad:charm-assets-apidoc-caching into launchpad:master.
diff --git a/charm/launchpad-assets/templates/vhost.conf.j2 b/charm/launchpad-assets/templates/vhost.conf.j2
index 7d427d7..088afe7 100644
--- a/charm/launchpad-assets/templates/vhost.conf.j2
+++ b/charm/launchpad-assets/templates/vhost.conf.j2
@@ -10,7 +10,6 @@
AddType application/vnd.sun.wadl+xml;qs=0.9 .wadl
AddType application/vd.sun.wadl+xml;qs=0.8 .brokenwadl
AddType application/json;qs=0.9 .json
- Header set Cache-Control "public,max-age=5184000"
Require all granted
</Location>
Alias "/+apidoc/" "{{ payloads_dir }}/{{ build_label }}/lib/canonical/launchpad/apidoc/"