We use varnish as our load balancer (among other things) but we get some strange behavior at the moment.
We have a script that gets called with some parameters, and depending on what parmas you pass, you get redirected to a different location using a 301 redirect (this it done with a php script and the header() function)
The problem is that the first time a URL is begin called the 301 redirect happens, but then the next time that same URL is called, you get a status of 200 OK, no redirect happens and just a white page is displayed.
I've added a session_start() to the top of the php script to try and stop varnish from caching the page, but nothing helped so far.
I've done some research regarding this issue, and saw that several people experience the same problem, but I wasn't able to find a solution yet.
How would I get varnish the stop caching the page?
Any help in the right direction will be appreciated.