Managing static file generated by PHP CMS

eagle sbc sbc19861004 at gmail.com
Fri Jan 7 13:09:43 MSK 2011


Hello, Anto:

That the way we use to solve what you encountered:
Compile nginx with 'cache_purge' module (module:
http://labs.frickle.com/nginx_ngx_cache_purge/)
Use 'proxy_cache' to store the generated static file instead of
'proxy_store', and when the file changed, the application server(CMS, I
think in your app) will purge that file actively.
Part of the configure file:

proxy_cache_path  /cache/proxy_cache_dir levels=2:2 keys_zone=cache_one:500m
inactive=3d max_size=100g;
 location ~ /purge(/.*)
  {
                        allow            127.0.0.1;
                        allow            192.168.1.0/24;
                        deny            all;
                        proxy_cache_purge    cache_one   $1;
 }

Hope it helps.

On Fri, Jan 7, 2011 at 1:48 AM, Anto <aryanto at chello.at> wrote:

>  Hello everybody,
>
> I am looking for suggestions to accomplish what I would like to achieve.
>
> Suppose we have a PHP based CMS which could generate a static file copy of
> a HTML page, every time nginx access it via fastcgi. I think the basic
> configuration on nginx would be like below:
>
> try_files $uri @cms;
>
> location @cms {
>    fastcgi_pass unix:/tmp/fastcgi.socket;
> }
>
> The problem would be that nginx will always serve the static file until it
> gets purged. So that if the CMS updated the HTML page, the client will never
> get that new version. Is there any way to do that purging or update
> mechanism in nginx? Or should that be done by the CMS or external cron like
> program?
>
> Would it not be the same situation if we would use fastcgi_store directive?
>
> Thanks in advance for your response.
>
> Kind regards,
>
> Anto
>
>
> _______________________________________________
> nginx mailing list
> nginx at nginx.org
> http://nginx.org/mailman/listinfo/nginx
>
>


-- 
自由是我生命之基石,尊重是我行为之准绳
也许我以千百种方式生活在这世上,但我坚守我人生之信仰
所以,我的朋友
请平视的看着我,带着你的微笑
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://nginx.org/pipermail/nginx/attachments/20110107/e791607f/attachment.html>


More information about the nginx mailing list