Vesta Control Panel - Forum

Community Forum

Skip to content

Advanced search
  • Quick links
    • Main site
    • Github repo
    • Google Search
  • FAQ
  • Login
  • Register
  • Board index Main Section Web Server
  • Search

Cache-Control and Expires

Questions regarding the Web Server
Apache + Nginx, Nginx + PHP5-FPM
Post Reply
  • Print view
Advanced search
6 posts • Page 1 of 1
floown
Posts: 87
Joined: Wed Nov 19, 2014 1:51 pm

Os: Ubuntu 15x
Web: apache + nginx
Cache-Control and Expires
  • Quote

Post by floown » Wed Mar 30, 2016 12:56 pm

Hello,

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
I have selected "caching" for Nginx.

Why the expire cache is in 1978 ?
Why cache-control is "no-cache" ?

What can I do, please?
Top

skurudo
VestaCP Team
Posts: 8099
Joined: Fri Dec 26, 2014 2:23 pm
Contact:
Contact skurudo
Website Facebook Google+ Skype
Twitter

Re: Cache-Control and Expires
  • Quote

Post by skurudo » Thu Mar 31, 2016 5:31 am

floown wrote:Why the expire cache is in 1978 ?
Version one: https://en.wikipedia.org/wiki/Dries_Buytaert
Version two about time travel...;)
floown wrote:Why cache-control is "no-cache" ?
The contents of the “Cache-Control” field depends on the sign of the specified time:
* 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
floown wrote:What can I do, please?
You can change nginx template or nginx config.
What do you want to do?
Top

floown
Posts: 87
Joined: Wed Nov 19, 2014 1:51 pm

Os: Ubuntu 15x
Web: apache + nginx
Re: Cache-Control and Expires
  • Quote

Post by floown » Thu Mar 31, 2016 10:39 am

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?
Top

leisegang
Posts: 64
Joined: Mon Feb 29, 2016 7:24 pm

Re: Cache-Control and Expires
  • Quote

Post by leisegang » Thu Mar 31, 2016 3:18 pm

You can us 'ab' to test your server:

http://www.cyberciti.biz/tips/howto-per ... erver.html
Top

skurudo
VestaCP Team
Posts: 8099
Joined: Fri Dec 26, 2014 2:23 pm
Contact:
Contact skurudo
Website Facebook Google+ Skype
Twitter

Re: Cache-Control and Expires
  • Quote

Post by skurudo » Fri Apr 01, 2016 1:13 pm

To test your server you can use ab, like leisegang suggested, or install siege
I lke siege more ;)
Top

floown
Posts: 87
Joined: Wed Nov 19, 2014 1:51 pm

Os: Ubuntu 15x
Web: apache + nginx
Re: Cache-Control and Expires
  • Quote

Post by floown » Fri Apr 01, 2016 5:17 pm

Thx guys, Ab doesn't work for me, the options (help) is displayed instead to apply the command.

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
I don't know if it's a good result ^^

//EDIT : ab works, I have just add the trailing slash ! :p
Top


Post Reply
  • Print view

6 posts • Page 1 of 1

Return to “Web Server”



  • Board index
  • All times are UTC
  • Delete all board cookies
  • The team
Powered by phpBB® Forum Software © phpBB Limited
*Original Author: Brad Veryard
*Updated to 3.2 by MannixMD
 

 

Login  •  Register

I forgot my password