cache static content in memory

Ryan Malayter malayter at gmail.com
Wed Feb 24 08:06:51 MSK 2010


On Mon, Feb 22, 2010 at 4:12 PM, budala10 <nginx-forum at nginx.us> wrote:
> What does the proxy cache?
> Cache php files with queries or only static data.
> I need a php cace does this do that?
> example php?id=2&r=tr
> the output from the php do i want to cache so the backend don't get a request before the cache is cleared.
> how, with proxy cache or proxy store ?

You want to use proxy_cache in nginx, but you should set appropriate
Cache-Control headers in your PHP scripts so that nginx will obey
them.

Typically, to cache the output of a PHP script in a proxy like nginx,
you would want something like "Cache-Control: public,max-age=3600"

Most PHP implementations set "Cache-Control: private" or
"Cache-Control: no-cache" by default for all pages, which you need to
override.

-- 
RPM



More information about the nginx mailing list