Jac*_*cob 4 php include varnish edge-side-includes
即使是最简单的Varnish Cache ESI测试也无法正常工作.
经过尝试和尝试,我想我在这里问.
基本上它只是不包括ESI文件.它只是返回HTML而不做它的包含.
这是我的varnish start命令:
varnishd -f /etc/varnish/default.vcl -s malloc,128M -T 127.0.0.1:2000 -a 0.0.0.0:8080;
Run Code Online (Sandbox Code Playgroud)
这是我正在测试的URL:
http://vbox.local:8080/varnish-tests/test.php
Run Code Online (Sandbox Code Playgroud)
我的vcl规则:
1)default.vcl
backend default {
.host = "127.0.0.1";
.port = "80";
}
sub vcl_fetch {
if (req.url ~ "test.php") {
esi; /* Do ESI processing */
set beresp.ttl = 24h;
} elseif (req.url ~ "esi_1.php") {
set beresp.ttl = 1m;
}
return(deliver);
}
Run Code Online (Sandbox Code Playgroud)
我的示例测试esi代码
2)test.php
<html>
<head>
<?php echo "Time 1: ".time(); ?>
<br />
The time 2 is: <esi:include src="/varnish-tests/esi_1.php"/> at this very moment.
</body>
</html>
Run Code Online (Sandbox Code Playgroud)
php到esi包括
3)esi_1.php
<?php
echo "Time 2: ".time();
?>
Run Code Online (Sandbox Code Playgroud)
我已尝试过上述vcl规则的许多变体.
一切都行不通.只是看不出我哪里出错了?
任何建议/帮助非常感谢.
谢谢.
归档时间: |
|
查看次数: |
4699 次 |
最近记录: |