Merge ~cjwatson/launchpad:charm-assets-favicon into launchpad:master

Proposed by Colin Watson
Status: Merged
Approved by: Colin Watson
Approved revision: 79c203685b218f8c30e54e7d7d758d4f49573c46
Merge reported by: Otto Co-Pilot
Merged at revision: not available
Proposed branch: ~cjwatson/launchpad:charm-assets-favicon
Merge into: launchpad:master
Diff against target: 15 lines (+6/-0)
1 file modified
charm/launchpad-assets/templates/vhost.conf.j2 (+6/-0)
Reviewer Review Type Date Requested Status
Guruprasad Approve
Review via email: mp+444125@code.launchpad.net

Commit message

charm: Serve favicons from assets charm

Description of the change

This allows us to serve these files from the frontends without hitting the appservers. I'm not sure why we serve `lib/canonical/launchpad/images/launchpad.png` here rather than `lib/canonical/launchpad/images/favicon.ico` (and regardless of file extension, too!), but this is what we currently do on production so I thought it best to start by matching the existing setup.

I think in practice most browsers will prefer the icons declared in HTML via `lib/lp/app/templates/base-layout.pt`, but it doesn't hurt to serve these files too.

To post a comment you must log in.
Revision history for this message
Guruprasad (lgp171188) wrote :

LGTM 👍

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 65bc07f..b16fabb 100644
3--- a/charm/launchpad-assets/templates/vhost.conf.j2
4+++ b/charm/launchpad-assets/templates/vhost.conf.j2
5@@ -33,5 +33,11 @@
6 Require all granted
7 </Location>
8 Alias "/@@/" "{{ code_dir }}/lib/canonical/launchpad/images/"
9+
10+ <LocationMatch "^/favicon\.(?:ico|gif|png)$">
11+ Header set Cache-Control "public,max-age=5184000"
12+ Require all granted
13+ </LocationMatch>
14+ AliasMatch "^/favicon\.(?:ico|gif|png)$" "/srv/launchpad/code/lib/canonical/launchpad/images/launchpad.png"
15 </VirtualHost>
16

Subscribers

People subscribed via source and target branches

to status/vote changes: