Mikko Ohtamaa wrote
> 
> On Sat, Feb 18, 2012 at 00:00, Nathan Van Gheem <vangheem@> wrote:
> 
>> b) if I change a newsitem that affects my portal page, plone sends the
>>> invalidation for the newsitem, and  it sends the invalidation for the
>>> portal page affected as well?
>>>
>> No, it'll only invalidate that one page and normal ttls will take place
>> for the portal page.
>>
>> We've implemented our own manual purge method to address situations like
>> this.
> 
> 
> 
> URL based purge is good only when you know the URLs to purge and the
> content is not embedded in the listings (like news portlet). Purge works
> well for images and files which have fixed urls and don't have payload
> embedded in HTML. If the site is complex it's very hard to set rules how
> to
> purge the listing pages where the content item appears... I am not sure
> could this be done with etags and stuff? Plone internally does not know
> it.
> I think there was a trick involving the last catalog modification date,
> but
> I don't know how to execute it.
> 

I tried to come up with a generic solution involving headers
(http://svn.plone.org/svn/collective/experimental.depends/trunk/README.txt)
but I think it's pretty much impossible as there is no easy way to know
where a link to a page might turn up (in a navigation tree or listing).

I do think adding headers with the portal type and any portlets could be
useful - this would allow you to write Varnish VCL that bans pages which are
a Collection or contain a Collection portlet. 



> If  it's not too expensive you can simply purge the whole Varnish at once
> on every Plone edit:
> 
> http://opensourcehacker.com/2011/09/08/purge-varnish-cache-from-python-web-application/
> 
> Suitable for low edit volume sites.
> 

For these types of sites, I configure Varnish to ban all pages with a
Content-Type of text/html in addition to the subject of the PURGE request
itself:

    if (req.request == "PURGE") {
        if (req.http.X-Real-IP != "127.0.0.1") {
            error 405 "Not allowed.";
        }
        purge("obj.http.host == " req.http.host " && obj.url == " req.url);
        purge("obj.http.Content-Type ~ ^text/html");
        error 200 "Purged";
    }

Laurence


--
View this message in context: 
http://plone.293351.n2.nabble.com/Doubt-about-plone-caching-varnish-tp7291445p7297254.html
Sent from the Installation, Setup, Upgrades mailing list archive at Nabble.com.
_______________________________________________
Setup mailing list
[email protected]
https://lists.plone.org/mailman/listinfo/plone-setup

Reply via email to