Mailing List Archive

Cache parts of pages?
Our web site has a navigation bar on every page with a picture of the
day in it. Let's say that most pages never change after being created,
except for the navigation bar.

Is it possible to use Varnish in such a way that the "meat" of every
page is cached separately from the navbar, and on every request the
navbar is merged into the "meat" of the page just prior to delivery?

Idea: Have Apache deliver a page with server side include instructions
in it (to include the navbar). Then have Varnish cache those pages.
Have another Apache in front of Varnish that interprets the SSI
instructions. I have no idea how to configure the second Apache,
though. Furthermore, this is very kludgy. But I hope it illustrates
what I want.

Ideas?

Kai
Cache parts of pages? [ In reply to ]
In message <20071024143634.GG14097 at emptyhost.emptydomain.de>, Kai Grossjohann w
rites:
>Our web site has a navigation bar on every page with a picture of the
>day in it. Let's say that most pages never change after being created,
>except for the navigation bar.
>
>Is it possible to use Varnish in such a way that the "meat" of every
>page is cached separately from the navbar, and on every request the
>navbar is merged into the "meat" of the page just prior to delivery?

I'm working on it right now, it's called "ESI includes" and allow
you to do exactly that kind of thing.

See:
http://www.w3.org/TR/esi-lang

--
Poul-Henning Kamp | UNIX since Zilog Zeus 3.20
phk at FreeBSD.ORG | TCP/IP since RFC 956
FreeBSD committer | BSD since 4.3-tahoe
Never attribute to malice what can adequately be explained by incompetence.
Cache parts of pages? [ In reply to ]
Hi Kai. I believe you may be able to do this with nginx ssi together
with memcached.

Regards,
David

Kai Grossjohann wrote:
> Our web site has a navigation bar on every page with a picture of the
> day in it. Let's say that most pages never change after being created,
> except for the navigation bar.
>
> Is it possible to use Varnish in such a way that the "meat" of every
> page is cached separately from the navbar, and on every request the
> navbar is merged into the "meat" of the page just prior to delivery?
>
> Idea: Have Apache deliver a page with server side include instructions
> in it (to include the navbar). Then have Varnish cache those pages.
> Have another Apache in front of Varnish that interprets the SSI
> instructions. I have no idea how to configure the second Apache,
> though. Furthermore, this is very kludgy. But I hope it illustrates
> what I want.
>
> Ideas?
>
> Kai
>
> _______________________________________________
> varnish-misc mailing list
> varnish-misc at projects.linpro.no
> http://projects.linpro.no/mailman/listinfo/varnish-misc
>