0
我在學習光油,而且我無法理解一些非常基礎的知識。我創建了一個簡單的文件,我想漆在高速緩存中存儲,被稱爲test.php的,它看起來像這樣:光油:無法按預期方式使基本緩存工作
<?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>
有了這些標題,我預計光油在緩存中的文件存儲爲一個小時( 3600秒)。但是,當我運行varnishlog -b -o -i TxURL(要監控後端請求),我可以看到有流量。像這樣:
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
我該如何讓Varnish緩存這個文件,而不是每次都聯繫後端?