Merge lp:~abentley/charms/precise/charmworld/proxy-cache-key into lp:~juju-jitsu/charms/precise/charmworld/trunk

Proposed by Aaron Bentley
Status: Merged
Merged at revision: 29
Proposed branch: lp:~abentley/charms/precise/charmworld/proxy-cache-key
Merge into: lp:~juju-jitsu/charms/precise/charmworld/trunk
Diff against target: 83 lines (+20/-7)
5 files modified
README.md (+2/-1)
hooks/install (+1/-0)
nginx/cache-log.conf (+9/-0)
nginx/http (+7/-5)
revision (+1/-1)
To merge this branch: bzr merge lp:~abentley/charms/precise/charmworld/proxy-cache-key
Reviewer Review Type Date Requested Status
Juju-Jitsu Hackers Pending
Review via email: mp+144183@code.launchpad.net

Description of the change

Configure cache in ngnix

Implement caching via nginx configuration. Also, add cache logging.

As a driveby, fix documentation.

https://codereview.appspot.com/7183045/

To post a comment you must log in.
Revision history for this message
Richard Harding (rharding) wrote :

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'README.md'
2--- README.md 2013-01-11 20:53:06 +0000
3+++ README.md 2013-01-21 21:04:21 +0000
4@@ -19,7 +19,8 @@
5
6 Deploy Charmworld
7
8- juju deploy juju deploy cs:~juju-jitsu/precise/charmworld --constraints instance-type=m1.small
9+ juju deploy cs:~juju-jitsu/precise/charmworld --constraints \
10+ instance-type=m1.small
11
12 Once deployed relate mongodb to charmworld
13
14
15=== modified file 'hooks/install'
16--- hooks/install 2013-01-10 20:15:14 +0000
17+++ hooks/install 2013-01-21 21:04:21 +0000
18@@ -6,6 +6,7 @@
19 apt-get install -y bzr nginx python-virtualenv python-dev python-dateutil \
20 charm-helper-sh build-essential
21 cp nginx/http /etc/nginx/sites-available/default
22+cp nginx/cache-log.conf /etc/nginx/conf.d
23 service nginx restart
24
25 mkdir -p ~ubuntu/var/charms
26
27=== added file 'nginx/cache-log.conf'
28--- nginx/cache-log.conf 1970-01-01 00:00:00 +0000
29+++ nginx/cache-log.conf 2013-01-21 21:04:21 +0000
30@@ -0,0 +1,9 @@
31+log_format cache '***$time_local '
32+ '$upstream_cache_status '
33+ 'Cache-Control: $upstream_http_cache_control '
34+ 'Expires: $upstream_http_expires '
35+ '$host '
36+ '"$request" ($status) '
37+ '"$http_user_agent" '
38+ 'Args: $args ';
39+access_log /var/log/nginx/cache.log cache;
40
41=== modified file 'nginx/http'
42--- nginx/http 2013-01-10 20:15:14 +0000
43+++ nginx/http 2013-01-21 21:04:21 +0000
44@@ -27,18 +27,18 @@
45
46 server {
47
48- root /usr/share/nginx/www;
49- index index.html index.htm;
50+ root /usr/share/nginx/www;
51+ index index.html index.htm;
52
53
54 location /docs {
55- gzip on;
56+ gzip on;
57 alias /home/ubuntu/docs/trunk/build/html;
58 expires 5m;
59 }
60
61 location /static {
62- gzip on;
63+ gzip on;
64 expires 48h;
65 alias /home/ubuntu/charmworld/charmworld/static;
66 }
67@@ -51,6 +51,8 @@
68 proxy_pass http://pyramid;
69 proxy_cache my-cache;
70 proxy_cache_use_stale updating;
71- proxy_cache_valid 404 30m;
72+ proxy_cache_valid 404 30m;
73+ proxy_cache_valid 15m;
74+ proxy_cache_key "$host$request_uri$cookie_auth_tkt";
75 }
76 }
77
78=== modified file 'revision'
79--- revision 2013-01-17 15:10:02 +0000
80+++ revision 2013-01-21 21:04:21 +0000
81@@ -1,1 +1,1 @@
82-13
83+14

Subscribers

People subscribed via source and target branches

to all changes: