On Jan 9, 2009, at 5:40 AM, Tycon wrote:

>
> Does anyone have such a configuration working ?
>
> Basically it means that on every request nginx will use the URL as the
> key to perform a lookup on memcached and serve the page from there if
> it exists. If it's not cached then it will forward the request to
> pylons which will produce the page and store it in mecached, so
> subsequent request for the same page will be served by nginx using
> mecached without forwarding the request to pylons.
>
> Also, the parts of the page that should not be cached (such as the
> current user name, shopping basket, breaking news, etc) are handled
> using SSI (server side include)  which means that the page rendered by
> pylons include a special SSI tag for each dynamic part of the page
> (instead of the actual dynamic content).
>
> When nginx gets the page (either from pylons or memcached) it will
> look for those special SSI tags and for each one it will issue a
> request to pylons to render the dynamic part using the URL that is
> specified in the tag.
>
> So the bottom line is that for each page only the dynamic parts of the
> page will be rendered on each user request (dynamic parts are the ones
> that can be different even for request for the same URL). As I
> understand it from reading rails blogs, this is the holy grail of web
> app frameworks, as it can give tremendous performance even on low end
> hardware. At least it does on my development virtual machine.
>
>
> >

Yep, we've used it here to cache both Pylons and ASP and it absolutely  
screams.

Including the SSI tags works exactly as you said.  What I do is use a  
replacement tag in my templates (ie. {* user_status_line *})  and add  
code in my lib/base.py file to conditionally handle the replacement:

http://pylonshq.com/pasties/1043

Obviously, I also have an ssi controller that renders and outputs the  
user_status_line fragments (to be called directly from nginx).

TJ

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"pylons-discuss" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to