我試圖給我的網店增加一個警告。 設置清漆端口80,後端是127.0.0.1 apache2。清漆和apache問題(試圖改進OpenCart)
Apache Benchmark給出了awefull resulst,就像1-2個請求/秒!
在第一個顯示的文件上; header.tpl我:
<?php
cache_control("public, s-max-age=6000");
expires(to_gmt(time() + 6000));
?>
下面是響應頭:
HTTP/1.1 200 OK
Content-Length: 151613
Expires: Tue, 26 Feb 2013 20:04:07
Cache-Control: public, s-max-age=6000
Pragma: no-cache
Set-Cookie: PHPSESSID=i9h5ldj8k4fking69d03jr5244; path=/, language=en; expires=Thu, 28-Mar-2013 18:24:06 GMT; path=/; domain=www.domain.com, currency=CHF; expires=Thu, 28-Mar-2013 18:24:06 GMT; path=/; domain=www.domain.com
Content-Type: text/html; charset=utf-8
Accept-Ranges: bytes
Date: Tue, 26 Feb 2013 18:24:07 GMT
X-Varnish: 186646239
Age: 0
Via: 1.1 varnish
Connection: close
X-Cache: MISS
一定是失去了一些東西很明顯,但對我來說只是清漆不緩存;我究竟做錯了什麼 ?
如果您收聽未緩存的PHP響應,是否存在'Pragma:no-cache'? – 2013-02-26 18:32:57
是的,也存在。 – Disco 2013-02-26 18:36:13
相信我我試過了,它不可能改進opencart。也取決於開發人員,但我真的會去magento或其他東西。 – Dragunov 2017-02-23 15:44:56