0
votes

I use Varnish to cache content in different web applications (most of them based on Django and Drupal). Those familiar with Varnish will know that it doesn't cache pages with cookies, unless you do some VCL magic, as explained in the documentation. In most cases this means that your authenticated users won't benefit from Varnish caching (please correct me if I'm wrong about this and there's a way of caching parts of a page for authenticated users with Varnish).

So, I want to write this web application using HTML5 Web Storage to allow visitors to save some data locally and I was wondering if Varnish would work with it. I understand that Web Storage doesn't use the HTTP headers as cookies do, hence Varnish caching should work.

Can anybody who has played with Varnish and HTML5 Web Storage confirm this?

2

2 Answers

1
votes

(please correct me if I'm wrong about this and there's a way of caching parts of a page for authenticated users with Varnish).

You could use ESI for that, but it requires a few changes to the application to support ESI as well.

So, I want to write this web application using HTML5 Web Storage to allow visitors to save some data locally and I was wondering if Varnish would work with it. I understand that Web Storage doesn't use the HTTP headers as cookies do, hence Varnish caching should work.

Since that cache is entirely client-side, it's indeed unrelated to Varnish, your server does not even know if there's a client-side cache being used or not, since that's application logic.

0
votes

It will work nicely if you use javascript to replace content use web storage.

You have to be careful though, otherwise user will see a "flicker" or JS replacing content.