Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Varnish: Misc

Cache HTTP 404 Page

 

 

Varnish misc RSS feed   Index | Next | Previous | View Threaded


kelvin1111111 at gmail

Apr 13, 2012, 4:13 AM

Post #1 of 5 (1385 views)
Permalink
Cache HTTP 404 Page

I am not sure if this is workable, is these a way for Varnish to cache 404 page?

I have a HTTP flood attack to the website, and they always target
invalid URL, I do not want these traffic to go to backend server.

Of course I could do more on network layer, but unfortunately it's out
of my control and it always takes longer time for change request :)

_______________________________________________
varnish-misc mailing list
varnish-misc [at] varnish-cache
https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc


apj at mutt

Apr 13, 2012, 4:33 AM

Post #2 of 5 (1305 views)
Permalink
Re: Cache HTTP 404 Page [In reply to]

On Fri, Apr 13, 2012 at 07:13:42PM +0800, Kelvin Loke wrote:

> I am not sure if this is workable, is these a way for Varnish to cache 404 page?

Varnish will do so by default. If it doesn't, it's because you have VCL or
backend headers (Expires or Cache-Control) preventing the caching.

--
Andreas

_______________________________________________
varnish-misc mailing list
varnish-misc [at] varnish-cache
https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc


kelvin1111111 at gmail

Apr 13, 2012, 4:54 AM

Post #3 of 5 (1318 views)
Permalink
Re: Cache HTTP 404 Page [In reply to]

Thanks Andreas, just realized that the backend server sets "Age: 0",
this might the reason why Varnish didn't cache 404 page.

By the way, if Varnish will cache 404 by default, what is the default
TTL for this? Is there a way to set a custom TTL for 404 caching?


On Fri, Apr 13, 2012 at 7:33 PM, Andreas Plesner Jacobsen <apj [at] mutt> wrote:
> On Fri, Apr 13, 2012 at 07:13:42PM +0800, Kelvin Loke wrote:
>
>> I am not sure if this is workable, is these a way for Varnish to cache 404 page?
>
> Varnish will do so by default. If it doesn't, it's because you have VCL or
> backend headers (Expires or Cache-Control) preventing the caching.
>
> --
> Andreas
>
> _______________________________________________
> varnish-misc mailing list
> varnish-misc [at] varnish-cache
> https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc

_______________________________________________
varnish-misc mailing list
varnish-misc [at] varnish-cache
https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc


apj at mutt

Apr 13, 2012, 5:26 AM

Post #4 of 5 (1340 views)
Permalink
Re: Cache HTTP 404 Page [In reply to]

On Fri, Apr 13, 2012 at 07:54:19PM +0800, Kelvin Loke wrote:

> >> I am not sure if this is workable, is these a way for Varnish to cache 404 page?
> >
> > Varnish will do so by default. If it doesn't, it's because you have VCL or
> > backend headers (Expires or Cache-Control) preventing the caching.
>
> Thanks Andreas, just realized that the backend server sets "Age: 0",
> this might the reason why Varnish didn't cache 404 page.

No. Age is used to provide clients an indication of how long an object has been
stored in a cache.

> By the way, if Varnish will cache 404 by default, what is the default
> TTL for this? Is there a way to set a custom TTL for 404 caching?

Same as for every other object: derived from cache-control (max-age, s-maxage),
expires or default_ttl

Please fix your quoting.

--
Andreas

_______________________________________________
varnish-misc mailing list
varnish-misc [at] varnish-cache
https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc


apj at mutt

Apr 13, 2012, 5:33 AM

Post #5 of 5 (1306 views)
Permalink
Re: Cache HTTP 404 Page [In reply to]

On Fri, Apr 13, 2012 at 02:26:56PM +0200, Andreas Plesner Jacobsen wrote:
>
> Same as for every other object: derived from cache-control (max-age, s-maxage),
> expires or default_ttl

Or of course set by VCL

--
Andreas

_______________________________________________
varnish-misc mailing list
varnish-misc [at] varnish-cache
https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc

Varnish misc RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.