My question is this: can I achieve the same if login sessions are involved. ie. when I want to serve content to only registered users and not otherwise. So how to overcome sessions when it comes to caching and finally to use the cache next time for another session?
The goal of my website is to serve content to only registered users.
There are plenty of users logged in, each having different session IDs.
A php page queries the DB and finds "XYZ" that user "A" wants and generates HTML output.
Now if user "B" (with a different session ID) after sometime wants the same "XYZ", how to make Nginx to deliver from cache without making the php page to query the db again.
Has anybody done this before?
Clarification regarding possible question dupes:
nginx caching dynamic content to static My question is caching dynamic content when sessions are involved. The above question is more general (no mention about sessions).