We are happy to announce that Vesta is back under active development as of 25 February 2024. We are working on Vesta 2.0 and expect to release it by the end of 2024. Read more about it: https://vestacp.com/docs/vesta-2-development
Cache-Control and Expires
Cache-Control and Expires
Hello,
Here is my cache header :
I have selected "caching" for Nginx.
Why the expire cache is in 1978 ?
Why cache-control is "no-cache" ?
What can I do, please?
Here is my cache header :
Code: Select all
Server: nginx
Date: Wed, 30 Mar 2016 11:24:20 GMT
Content-Type: text/html; charset=utf-8
Content-Length: 13172
Connection: keep-alive
Keep-Alive: timeout=60
Vary: Host,Accept-Encoding
X-Powered-By: PHP/5.5.9-1ubuntu4.14
Expires: Sun, 19 Nov 1978 05:00:00 GMT
Cache-Control: no-cache, must-revalidate, post-check=0, pre-check=0
x-content-type-options: nosniff
Content-Language: fr
Link: <http://www.mydomain.com/home>; rel="canonical",<http://www.mydomain.com/node/8>; rel="shortlink"
Content-Encoding: gzip
200 OK
Why the expire cache is in 1978 ?
Why cache-control is "no-cache" ?
What can I do, please?
Re: Cache-Control and Expires
Version one: https://en.wikipedia.org/wiki/Dries_Buytaertfloown wrote:Why the expire cache is in 1978 ?
Version two about time travel...;)
The contents of the “Cache-Control” field depends on the sign of the specified time:floown wrote:Why cache-control is "no-cache" ?
* time is negative — “Cache-Control: no-cache”.
* time is positive or zero — “Cache-Control: max-age=t”, where t is a time specified in the directive, in seconds.
The max parameter sets “Expires” to the value “Thu, 31 Dec 2037 23:55:55 GMT”, and “Cache-Control” to 10 years.
http://nginx.org/en/docs/http/ngx_http_ ... odule.html
You can change nginx template or nginx config.floown wrote:What can I do, please?
What do you want to do?
Re: Cache-Control and Expires
Hello ^^
Thx for your respons. In fact I wanted to activate all cache solutions to have a fastest server. So I have switch "defaut" template in Ngix to "caching". I wanted to control if the server works now faster. Can I do a benchmark? With what command?
Thx for your respons. In fact I wanted to activate all cache solutions to have a fastest server. So I have switch "defaut" template in Ngix to "caching". I wanted to control if the server works now faster. Can I do a benchmark? With what command?
Re: Cache-Control and Expires
To test your server you can use ab, like leisegang suggested, or install siege
I lke siege more ;)
I lke siege more ;)
Re: Cache-Control and Expires
Thx guys, Ab doesn't work for me, the options (help) is displayed instead to apply the command.
So I have try : httperf
I don't know if it's a good result ^^
//EDIT : ab works, I have just add the trailing slash ! :p
So I have try : httperf
Code: Select all
httperf --server mydomain.com --port 8080 --num-conns 100
httperf --client=0/1 --server=mydomain.com --port=8080 --uri=/ --send-buffer=4096 --recv-buffer=16384 --num-conns=100 --num-calls=1
httperf: warning: open file limit > FD_SETSIZE; limiting max. # of open files to FD_SETSIZE
Maximum connect burst length: 1
Total: connections 100 requests 100 replies 100 test-duration 8.836 s
Connection rate: 11.3 conn/s (88.4 ms/conn, <=1 concurrent connections)
Connection time [ms]: min 74.6 avg 88.4 max 1072.6 median 76.5 stddev 99.6
Connection time [ms]: connect 49.2
Connection length [replies/conn]: 1.000
Request rate: 11.3 req/s (88.4 ms/req)
Request size [B]: 67.0
Reply rate [replies/s]: min 12.6 avg 12.6 max 12.6 stddev 0.0 (1 samples)
Reply time [ms]: response 39.2 transfer 0.0
Reply size [B]: header 350.0 content 234.0 footer 0.0 (total 584.0)
Reply status: 1xx=0 2xx=0 3xx=100 4xx=0 5xx=0
CPU time [s]: user 8.45 system 0.29 (user 95.6% system 3.3% total 98.9%)
Net I/O: 7.2 KB/s (0.1*10^6 bps)
Errors: total 0 client-timo 0 socket-timo 0 connrefused 0 connreset 0
Errors: fd-unavail 0 addrunavail 0 ftab-full 0 other 0
//EDIT : ab works, I have just add the trailing slash ! :p