2

I have got varnish installed on my server. I have a page on my site which i would like to get cached via Varnish. With fresh varnish installation, I created a PHP page with some content in it. loaded the page. Varnish worked fine.

But as I added session_start() on first line of that page, The varnish cache stopped working.

What is the problem with Varnish and PHP session ? Can anyone help

1 Answers1

3

I suggest you read the Varnish Book http://book.varnish-software.com/4.0/

It explains how Varnish and HTTP caches work.

You cannot have a session and cache the content at the same time.
You could configure varnish to do so, but it would be a different cache per different user (session) which makes the whole caching useless (depending on the website).

Cha0s
  • 2,432
  • 2
  • 15
  • 26