Quick Nav:  Online Store   |   Login | Register

Caching one version of a page for all users

Rate this topic:

Please Register to post a reply. Another benefit of registration is the ability to subscribe to and recieve notifications of new posts.
AuthorMessages
Nathan Wichmann
<20 Posts
Posts:9


08/12/2008 10:35 PM  

Hi There,

My site has two classes of users, unauthenticated users and subscribed users.  In the PB config I've specified the name of my subscriber role under the 'Cached Roles' section.  What I want is for one page to be cached for ANY member of that role.  However it seems that a seperate page is being cached for every member of that role i.e. if 3 subscribed users hit the home page I end up with 3 different cached pages. Can someone shed some light on this?

Thanks,
Nathan

John Mitchell
Posts:3471


08/13/2008 10:12 AM  
Hi Nathan,
You are correct, and that is by design. Once you cache users it purposely makes sure that every user gets their own page. Caching by role is just a way to make it cache a specific group of users.

If it didn't do this then you would see problems with user specific content. For example the link to their profile page would end up getting cached with the name of the first person to request that page.

In other words, just because someone is in a certain role, it doesn't mean that everything they see is the same as someone else that is in that role. If two people were in a cached role, but only one of them were in the administrator role, then that could lead to other problems like the control panel showing up for users that are not authorized to see it.
Nathan Wichmann
<20 Posts
Posts:9


08/13/2008 4:50 PM  
Hi John,

Thanks very much for your prompt response. I'm not sure of the technical feasability of the following suggestions, but I'd like to put forward a couple of ideas:

1. Pages could be cached for users in common roles: i.e. One cached page for users in the 'subscriber' role only, and one for users in the 'subscriber' AND 'editor' roles.
2. For page difference scenarios that wouldn't be solved by 1 the ability to specify certain modules / areas of the page that would be refreshed for each user whilst the bulk of the page is cached. Once again I don't know the technical feasibility in the PB/DNN world but I know ASP.NET substitution lets you do this sort of thing.

Just wanted to mention this as it's a real killer in our scenario where our users mostly belong to roles (and need to be to access exclusive content).
John Mitchell
Posts:3471


08/13/2008 5:36 PM  
Thanks for the suggestions, but I don't think that would solve the issues I stated earlier. The key is not to bypass the internal security of DNN, and that is done by checking if a specific user is in *one of* the allowed roles for the module. You can't really turn it around and cache complete requests by looking at the role first.

I did give this a lot of thought, and even considered something in-between where pages could be cached depending on *all* of the roles a user belongs to. But even this option doesn't help when there is personalized content that is not checking a role but a specific user.

The module level caching in DNN should handle most of what you are trying to achieve.
If you cache at the module level then there will not be much more gain in caching the whole page as most DB calls will be eliminated. If the module(s) can't be cached when authenticated, then that is an indication that page can't be cached unless each user is cached separately.

If you do have entire pages that are viewed over and over again by specific users (even if their output doesn't change at all between different authenticated users), then you will still gain by caching them by user.
John Mitchell
Posts:3471


08/13/2008 5:40 PM  

By the way, the scenario you describe in suggestion number 2 can be implemented using AJAX.

 

Please Register to post a reply. Another benefit of registration is the ability to subscribe to and recieve notifications of new posts.
Forums >Snapsis Product Support >PageBlaster > Caching one version of a page for all users



ActiveForums 3.7
Powered by: Snapsis Software