-
Notifications
You must be signed in to change notification settings - Fork 121
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Added setup for serving PHP with Apache and a cache for it.
- Loading branch information
António P. P. Almeida
committed
Oct 30, 2011
1 parent
d4bd108
commit 80f148c
Showing
6 changed files
with
77 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# -*- mode: nginx; mode: flyspell-prog; ispell-local-dictionary: "american" -*- | ||
|
||
### Defining the proxy cache zone for Piwik's piwik.php file. That's | ||
### the file that the JS bug calls. | ||
|
||
## If youre using a Nginx version greater than 1.1.1 then you can | ||
## tweak the Tweaking of the cache loader parameters. | ||
## Cf. http://forum.nginx.org/read.php?21,213197,213209#msg-213209 for | ||
## rationale. If you're using a Nginx version lower than 1.1.1 then | ||
## comment the line below and use the cache zone configuration below this one. | ||
proxy_cache_path /var/cache/nginx/proxycache levels=1:2 keys_zone=proxycache:100k max_size=10M inactive=3h loader_threshold=2592000000 loader_sleep=1 loader_files=100000; | ||
|
||
## If you're not using a Nginx version greater or equal to 1.1.1 then | ||
## comment the above configuration and use this one. No cache loader | ||
## tweaking. | ||
#proxy_cache_path /var/cache/nginx/proxycache levels=1:2 keys_zone=proxycache:100k max_size=10M inactive=3h; |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# -*- mode: nginx; mode: flyspell-prog; ispell-local-dictionary: "american" -*- | ||
|
||
### Implementation of the microcache concept as presented here: | ||
### http://fennb.com/microcaching-speed-your-app-up-250x-with-no-n | ||
|
||
## The cache zone referenced. | ||
proxy_cache proxycache; | ||
## The cache key. | ||
proxy_cache_key $host$request_uri; | ||
|
||
## For 200 and 301 make the cache valid for 2 hours. | ||
proxy_cache_valid 200 301 2h; | ||
## For 302 make it valid for 30 minutes. | ||
proxy_cache_valid 302 30m; | ||
## For 404 make it valid 10 minutes. | ||
proxy_cache_valid 404 10m; | ||
## If there are any upstream errors or the item has expired use | ||
## whatever it is available. | ||
proxy_cache_use_stale error timeout invalid_header updating http_500 http_502 http_503 http_504; | ||
## The Cache-Control and Expires headers should be delivered untouched | ||
## from the upstream to the client. | ||
proxy_ignore_headers Cache-Control Expires; | ||
## If we have a cookie we should bypass the cache. The same if we have a | ||
proxy_cache_bypass $no_cache; | ||
proxy_no_cache $no_cache; | ||
## Add a cache miss/hit status header. | ||
add_header X-Piwik-Cache $upstream_cache_status; | ||
## To avoid any interaction with the cache control headers we expire | ||
## everything on this location immediately. | ||
expires epoch; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters