I'm learning Varnish, and I am having trouble understanding some very basics. I have created a simple file i want Varnish to store in cache, called test.php and it looks like this:
<?php
header("Cache-Control: public, must-revalidate, max-age=0, s-maxage=3600" ); // <-- This should make Varnish cache, right?
?>
<!DOCTYPE HTML>
<html>
<body>
<h1> test </h1>
</body>
</html>
With these headers, I expected Varnish to store the file in cache for an hour(3600 seconds). However when i run varnishlog -b -o -i TxURL(To monitor request to backend), i can see that there is traffic. Like this:
13 BackendClose b default
13 BackendOpen b default 127.0.0.1 57857 127.0.0.1 8080
13 TxURL b /test.php
13 BackendReuse b default
13 TxURL b /test.php
13 BackendReuse b default
13 TxURL b /test.php
How can I make Varnish cache this file, and not contact the backend each time?