Question from Dec. 2009: "still using cache when fetching content"

2010-01-08 Thread John Norman
Hi. I've just subscribed, and have been reading through the e-mail archives
for varnish-misc.

In Dec. 2009, Jean-Christophe Petit asked (with subject "still using cache
when fetching content"):

-
Is it possible to make Varnish sending the cache content at the same
time it is fetching from the backend ?
It will be more efficient for slow dynamic content ;)
For example, I have a php page taking up to 5sec to run. If Varnish was
able to get it while still sending the old cache page, it would be
really great.
No more unlucky visitor hitting it to update the cache..
-

There were a couple of replies, but I just wanted to flesh out the "use
case":

I think the scenario would be:

(1) There is a page that takes a very long time to render (say, 90 seconds)
(2) It is cached, perhaps to expire after an hour
(3) In normal usage, everyone gets the cached page and is very happy
(4) An administrator would like to refresh that page in the cache BEFORE the
hour is up; but give any user the earlier cached page
(6) The admin would like a mechanism: "Please refresh now with this request,
but until the request is finished, serve whatever is in the cache."

This is different from grace, 'cos no one (except the admin) is incurring
the wait; and also the admin is asking for a refresh before the cached page
has expired.

Is this a feature that can be simulated in Varnish? Or a feature that might
be added at some time?

What we're concerned about is Google's timing of page download. If we set a
cache period to, say, an hour, and Google incurs the "first hit" after cache
expiry, then it (Google) has to wait for the finished page. In grace mode,
requests after the Google hit would get the earlier cached page; but, still,
Google has measured the page as taking, say, 60 seconds to download. In the
model above, Google would get the cached page; it would just be stale.

Thoughts?

John
___
varnish-misc mailing list
varnish-misc@projects.linpro.no
http://projects.linpro.no/mailman/listinfo/varnish-misc


Re: Question from Dec. 2009: "still using cache when fetching content"

2010-01-08 Thread John Norman
I think Chris Davies has straightened me out, and that the scenario I
describe *is* covered by grace -- that the first hit would also get stale
(as well as others in the grace period), which is exactly what I want.

On Fri, Jan 8, 2010 at 4:20 PM, John Norman  wrote:

> Hi. I've just subscribed, and have been reading through the e-mail archives
> for varnish-misc.
>
> In Dec. 2009, Jean-Christophe Petit asked (with subject "still using cache
> when fetching content"):
>
> -
> Is it possible to make Varnish sending the cache content at the same
> time it is fetching from the backend ?
> It will be more efficient for slow dynamic content ;)
> For example, I have a php page taking up to 5sec to run. If Varnish was
> able to get it while still sending the old cache page, it would be
> really great.
> No more unlucky visitor hitting it to update the cache..
> -
>
> There were a couple of replies, but I just wanted to flesh out the "use
> case":
>
> I think the scenario would be:
>
> (1) There is a page that takes a very long time to render (say, 90 seconds)
> (2) It is cached, perhaps to expire after an hour
> (3) In normal usage, everyone gets the cached page and is very happy
> (4) An administrator would like to refresh that page in the cache BEFORE
> the hour is up; but give any user the earlier cached page
> (6) The admin would like a mechanism: "Please refresh now with this
> request, but until the request is finished, serve whatever is in the cache."
>
> This is different from grace, 'cos no one (except the admin) is incurring
> the wait; and also the admin is asking for a refresh before the cached page
> has expired.
>
> Is this a feature that can be simulated in Varnish? Or a feature that might
> be added at some time?
>
> What we're concerned about is Google's timing of page download. If we set a
> cache period to, say, an hour, and Google incurs the "first hit" after cache
> expiry, then it (Google) has to wait for the finished page. In grace mode,
> requests after the Google hit would get the earlier cached page; but, still,
> Google has measured the page as taking, say, 60 seconds to download. In the
> model above, Google would get the cached page; it would just be stale.
>
> Thoughts?
>
> John
>
>
___
varnish-misc mailing list
varnish-misc@projects.linpro.no
http://projects.linpro.no/mailman/listinfo/varnish-misc


Re: Question from Dec. 2009: "still using cache when fetching content"

2010-01-11 Thread Poul-Henning Kamp
In message , John 
Norman writes:

>-
>Is it possible to make Varnish sending the cache content at the same
>time it is fetching from the backend ?

It's in the plans, but there are some code that needs to be smartend
up first, so it will take a bit of time.

-- 
Poul-Henning Kamp   | UNIX since Zilog Zeus 3.20
p...@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.
___
varnish-misc mailing list
varnish-misc@projects.linpro.no
http://projects.linpro.no/mailman/listinfo/varnish-misc