I’m using nginx with apache2 + mod_php.
Php pages are proxied to apache and nginx handles all static files (css,
js, png, jpg, gif).
I have lots of small files (forum design + smilies) …
Can nginx cache theses files in memory? How?
If so, do I have any benefit with this approach?
Is this faster than serving from disk?
your system has already a file cache memory. It does the trick.
If you want to use nginx cache capabilities, you can make nginx
reverse proxies all requests to apache (even static ones) and set up a
cache (proxy_cache* directives). But ningx will put cached files on
disk et read them on demand. It will benefits of system cache as well.
I asked myself the same question weeks ago but in my case static files
were not on a local disk but on a NFS shared disk. So I let apache to
serve statiques pages as well and cache them localy.
I’m using nginx with apache2 + mod_php.
Php pages are proxied to apache and nginx handles all static files (css, js, png, jpg, gif).
I have lots of small files (forum design + smilies) …
Can nginx cache theses files in memory? How?
If so, do I have any benefit with this approach?
Is this faster than serving from disk?
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
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.