Changeset 52:248c69b19dbf in minitage/eggs/minitage.paste
- Timestamp:
- 08/16/08 11:27:43 (5 months ago)
- Author:
- kiorky <kiorky@…>
- Message:
-
0.0.1_alpha36
- Improve varnish default vcl
0.0.1_alpha35
- Improve varnish default vcl
- Files:
-
Legend:
- Unmodified
- Added
- Removed
-
|
r51
|
r52
|
|
| 2 | 2 | CHANGES |
| 3 | 3 | ============== |
| | 4 | 0.0.1_alpha36 |
| | 5 | --------------- |
| | 6 | - Improve varnish default vcl |
| | 7 | |
| | 8 | 0.0.1_alpha35 |
| | 9 | --------------- |
| | 10 | - Improve varnish default vcl |
| | 11 | |
| 4 | 12 | 0.0.1_alpha34 |
| 5 | 13 | --------------- |
-
|
r51
|
r52
|
|
| 21 | 21 | error 405 "Not allowed"; |
| 22 | 22 | } |
| 23 | | lookup; |
| | 23 | purge_url(req.url); |
| | 24 | error 200 "Maybe purged."; |
| 24 | 25 | } |
| 25 | 26 | |
| … |
… |
|
| 59 | 60 | /* Always cache images and multimedia */ |
| 60 | 61 | if (req.url ~ "\.(jpg|jpeg|gif|png|tiff|tif|svg|swf|ico|mp3|mp4|m4a|ogg|mov|avi|wmv)$") { |
| 61 | | remove req.http.Cookie; |
| 62 | | lookup; |
| 63 | | } |
| 64 | | |
| 65 | | /* lookup plone/archetypes images */ |
| 66 | | if (req.http.content-type ~ "image.*" ) { |
| 67 | 62 | remove req.http.Cookie; |
| 68 | 63 | lookup; |
| … |
… |
|
| 123 | 118 | } |
| 124 | 119 | |
| 125 | | /* Deal with purge requests */ |
| 126 | | sub vcl_hit { |
| 127 | | if (req.request == "PURGE") { |
| 128 | | set obj.ttl = 0s; |
| 129 | | error 200 "Purged"; |
| 130 | | } |
| 131 | | if (!obj.cacheable) { |
| 132 | | pass; |
| 133 | | } |
| 134 | | deliver; |
| 135 | | } |
| 136 | | |
| 137 | | sub vcl_miss { |
| 138 | | if (req.request == "PURGE") { |
| 139 | | error 404 "Not in cache"; |
| 140 | | } |
| 141 | | fetch; |
| 142 | | } |
| 143 | | |
| 144 | 120 | sub vcl_hash { |
| 145 | 121 | set req.hash += req.url; |
| … |
… |
|
| 154 | 130 | |
| 155 | 131 | sub vcl_fetch { |
| 156 | | |
| 157 | | |
| 158 | 132 | /* Do not store errors in cache, as maybe they will be corrected soon :-) */ |
| 159 | | if (obj.status == 404 || obj.status == 500) { |
| 160 | | pass; |
| 161 | | } |
| 162 | | |
| 163 | | /* dont cache unauthenticated errors stuff */ |
| 164 | | if (obj.status == 503) { |
| | 133 | if (obj.status == 404) { |
| | 134 | pass; |
| | 135 | } |
| | 136 | |
| | 137 | /* dont cache 500 Internal Server Error; 501 Not Implemented; 502 Bad Gateway; 503 Service Unavailable; 504 Gateway Timeout */ |
| | 138 | if (obj.status == 500 || obj.status == 501 || obj.status == 502 || obj.status == 503 || obj.status == 504){ |
| | 139 | pass; |
| | 140 | } |
| | 141 | |
| | 142 | /* dont cache auth errors */ |
| | 143 | if (obj.status == 403) { |
| 165 | 144 | pass; |
| 166 | 145 | } |
-
|
r51
|
r52
|
|
| 7 | 7 | |
| 8 | 8 | name='minitage.paste' |
| 9 | | version = '0.0.1_alpha34' |
| | 9 | version = '0.0.1_alpha36' |
| 10 | 10 | |
| 11 | 11 | def read(rnames): |