I don't understand how a reverse proxy with caching works.
Let's assume that the cache is empty.
User1 loads index.php (dynamic content). There's no cache, so Nginx queries the php file. The server says "Welcome User1". Nginx stores the webpage using an md5 checksum.
User2 loads index.php. There is a page stored in the cache, so we return this page to the user. It says "Welcome User1", but if we had called the php script, it would have returned "Welcome User2".
How can Nginx know wether or not to call the php script again? My reverse proxy with caching works great, returning dynamic content, but I imagine it's not just "magic".
Is it the php script which returns a header telling Nginx not to cache?