Welcome! Log In Create A New Profile

Advanced

How to Cache dynamic content using Nginx when sessions are involved?

Posted by tinkutalking 
How to Cache dynamic content using Nginx when sessions are involved?
February 26, 2012 12:09AM
This site explains how to create static files from dynamic content using Nginx.
http://mark.ossdl.de/2009/07/nginx-to-create-static-files-from-dynamic-content/

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?

Detailed scenario:

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.
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 234
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready