Welcome! Log In Create A New Profile

Advanced

Caching and PHP ...

Posted by MartinW12 
Caching and PHP ...
August 12, 2020 03:28PM
Hello,

I am just migrating from Apache and am wondering how caching works for my PHP scripts.

If I go to my website on Apache, the response headers include:

```
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Pragma: no-cache
```

which obviously stops the browser from doing any caching.

However on Nginx the response headers are:

```
HTTP/1.1 200 OK
Server: nginx/1.19.1
Date: Wed, 12 Aug 2020 19:21:19 GMT
Content-Type: text/html; charset=UTF-8
Transfer-Encoding: chunked
Connection: keep-alive
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
X-Frame-Options: SAMEORIGIN
```

So my question is this - what in those response headers stops the browser from caching the output? The browser doesn't cache by the way, I am just trying to understand why ...

Thanks,

Martin
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 60
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready