Welcome! Log In Create A New Profile


Re: Time-of-day caching?

António P. P. Almeida
March 02, 2011 11:06AM
On 1 Mar 2011 17h04 WET, guzman.braso@gmail.com wrote:

> Hi there,
> We are currently using wordpress (many of them) running in apache
> with nginx in front of it using proxy_cache.
> Currently we are not managing anymore the wordpress and our
> customers do with them as they wish, some have cache enabled, some
> not. We wanted to use that module but as our customer have many
> different versions of wordpress it didn't fit for us.

Yes. It's tricky. But a very good solution, since you can just use
"one cache to rule them all".

> Right now we cache every static file for a day and all posts for 10
> minutes. To deal with the dynamic content (comments) we create a
> cache_key that uses the wordpress comment author cookie, so users do
> not feel the cache of the posts when submitting comments but it's
> just a perception, in fact the 10 minutes it's still happening it's
> just they do not see it.

Do you use ajax to update only fragments of the page and leave the
remainder unchanged?

> Our current config for this it's not rocket science but if anyone
> want it I would gladly share it.
> Regarding drupal may I send you later an e-mail asking for a tip? I
> want to cache a few hundred drupal sites with nginx and right now
> I'm passing to apache all pages requests as I've not found yet a
> nice way to deal with drupal creating a php session cookie for every
> user and as comments do not go to a specific url neither create a
> unique cookie, I can't detect them so easy as in wordpress.

Sure you can. May I suggest also for you to drop by the Nginx group at
groups.drupal.org? http://groups.drupal.org/nginx

Drupal 7 serves no cookie for anon users. Drupal 6 does. Unless you're
using pressflow, which doesn't. The removal of the cookie is related
to caching strategies.

When you post a comment there are specific patterns on the URI. Other
option is creating a module that sets a cookie when posting comments,
similar to what WP does.

> By the way, does anyone have in hand a simple way to use proxy_cache
> for all requests except POST ?

How about setting a var that busts the cache when non zero. E.g.:

if ($request_method = POST) {
set $no_cache 1;

then use it in http://wiki.nginx.org/HttpProxyModule#proxy_no_cache

--- appa

nginx mailing list
Subject Author Posted

Time-of-day caching?

Brent February 28, 2011 02:53PM

Re: Time-of-day caching?

Flavio Torres February 28, 2011 03:36PM

Re: Time-of-day caching?

António P. P. Almeida February 28, 2011 07:14PM

Re: Time-of-day caching?

valor March 01, 2011 12:08PM

Re: Time-of-day caching?

António P. P. Almeida March 02, 2011 11:06AM

Re: Time-of-day caching?

Brent March 01, 2011 03:45PM

Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 336
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready