Quick Nav:  Online Store   |   Login | Register
PrevPrev--NextNext
Understanding Caching and Parameters
Last Post 01 Mar 2010 03:05 PM by John Mitchell. 9 Replies.
Please Register to participate.
Sort: Print topic: Printer Friendly
AuthorMessages
Rodney
Posts:189


Send PM:Send Private Message

--
15 Apr 2008 09:08 PM

Firstly: when I added PB, the default option for Page Parameters was blank, but yet I saw some examples with “tabid” in it – what should it be at Portal Level? I also noticed “Firefox” as the Additional Cache Key – what does this do and should I have it in at portal level?


Secondly, I have a lot of dynamic content and want to make sure I am making optimum use of PB – for example, my user profile system (http://www.pokerdiy.com/Players/FamousPokerPlayerProfiles/tabid/554/Default.aspx) uses the same tab with a different ID:
e.g.
http://www.pokerdiy.com/Home/PokerPlayerProfile/tabid/391/ID/1/Default.aspx
http://www.pokerdiy.com/Home/PokerPlayerProfile/tabid/391/ID/10777/Default.aspx

So, from my understanding:
If I enable caching at Portal Level, with the TabID param, tab 391 will be cached. But because I have 1000’s of different users, I need to add a PB module on Tab 391 and add another variable (ID) so that each user is cached separately. Is that correct? I need to do the same thing for Groups/Events/Leagues etc. Also – assuming I have a lot of diskspace, I can jack up the max limit of disk pages to 5000 or something so that a lot more pages are cached to disk (100 is quite conservative, and I should not imagine each page is more than 200k or so, and I have 100 gig on my server). I can then cache them for 10 days or so for maximum effect.

thanks
Rodney Joyce
Smart-Thinker.com - DotNetNuke Modules for Social Networks
PokerDIY.com - Simple Poker Leagues
John Mitchell
Veteran Member
Posts:4384

Avatar

Administrator
Send PM:Send Private Message

--
15 Apr 2008 09:47 PM

The default option for Page Parameter should be populated from the global config file which by default is page-param="tabid"

In DNN you should always use at least tabid for the Page Parameter, but if you don't each and every Url will still be cached seperately, they'll just all be in one folder on the disk.

The page parameter is used to create a folder where all the different instances of cached pages (based on the entire url) are kept for that page.

When the cache is invalidated with a post-back or a manual hard refresh all the cache files for that folder will be deleted which will in turn remove those instances from memory.

So, for pages that have modules that create multiple pages themselves it is a good idea to add extra page parameters like forumid, or threadid, or articleid.

That will make PageBlaster narrow down what is considered a "page" so that a post-back on one forum thread doesn't clear the entire forum cache.

The Page Parameters for a page with forums on it may look like this:  tabid;forumid;threadid

This will not make more cached pages, it will just organize them differently so that a "page" that gets cleared does not clear all instances on the tab.

It would probably be a good idea to ad the ID param to the page that has the player profiles since the profiles are probably fairly static once updated and you could then avoid clearing out all the profiles everytime one is updated.

The Additonal Cache Key is for parameters that are not on the Url that you would like to use so that the pages are even more uniquly identified.  The one you are seeing is actually [ PB:Request.Browser.Browser ] and is added to make sure that different browsers are cached uniquely (mainly because the DNN Menu has different output for different browsers and will not work in FirFox if IE caches it first).

Using the additional cache key will create more cached pages than normally would be created with just the Url. 

Cached pages are generally only about 10K to 20K each because they are also compressed before caching them.  The cool part about this is not only less disk space, but also less space in memory, and the best thing is that now the page does not have to be compressed over and over again on every request.  Build it once, do optimizations and replacements, then save it in cache to return directly on the next 1000's of requests.

For disk caching, I would recommend even longer than 10 days if you have the space to cache more (I cache mine for 99 days)  unless you have something that is getting updated in a way that does not invalidate the cache.

Rodney
Posts:189


Send PM:Send Private Message

--
15 Apr 2008 10:46 PM
Thanks for the explanation - for some reason my defaults are not getting pulled through, so I changed "Firefox" to [ PB:Request.Browser.Browser ] and added tabID too.

I selected 10 days because some of my pages do not have any postbacks on them and will not be invalidated, but they pull info from a variety of sources so they need to be updated every now and again. I'll see how it goes - I THINK I am noticing a significant decrease in the SQL process size (was running at 900k and now at 500k) so hopefully this is due to PB...
thanks
Rodney Joyce
Smart-Thinker.com - DotNetNuke Modules for Social Networks
PokerDIY.com - Simple Poker Leagues
Nelson Fernandez
New Member
Posts:82


Send PM:Send Private Message

--
24 Feb 2010 02:20 PM
Does this still apply?

If I read this correctly, then you are saying that each page should have an instance of the module installed? Or is this somehow handles in the main Snapsis.PageBlaster.Config and can you post a real world example?
John Mitchell
Veteran Member
Posts:4384

Avatar

Administrator
Send PM:Send Private Message

--
24 Feb 2010 02:53 PM
Yes, page-param has always been a setting. No, you do not need a PageBlaster module on every page, you can add these parameters to the main Snapsis.PageBlaster.config file.

If you put it in the global config then all requests will look for all those parameters, so it will slow each request but only very slightly since it is a quick check.

A real world example is the ForumId one.

Don't go overboard with extra page parameters as having only one page per folder on the disk is also not efficient.
Nelson Fernandez
New Member
Posts:82


Send PM:Send Private Message

--
24 Feb 2010 03:02 PM
As an aexample, if I look at the current URL here on this site, I see that I could use something like: tabid;aff;aft ??

Does this negatively affect non forum pages?
Rodney
Posts:189


Send PM:Send Private Message

--
01 Mar 2010 12:28 PM
I am looking at this now - I noticed in PB you can also cache users and roles - is this recommended John? When would you use this? My site is very dynamic - would that be a problem?
thanks
Rodney Joyce
Smart-Thinker.com - DotNetNuke Modules for Social Networks
PokerDIY.com - Simple Poker Leagues
John Mitchell
Veteran Member
Posts:4384

Avatar

Administrator
Send PM:Send Private Message

--
01 Mar 2010 12:47 PM
If you set the module to cache users PageBlaster will cache a different cached page for each authenticated user.

I don't recommend caching authenticated users unless you have pages that each individual user will visit multiple times before it changes.

Rodney
Posts:189


Send PM:Send Private Message

--
01 Mar 2010 02:48 PM
Ok, I wont bother with that then.

At what stage of the lifecycle does PB do caching? For example - I run Ifinity URL Master so my profiles resolve to www.pokerdiy.com/rod.aspx for example - is it still caching on ID in the background?

Also - how to tell if it is working? I checked the cache folder and I lookup the TabID. However it is empty - do they get written to disk immediately or are they cached in memory for sometime first?
thanks
Rodney Joyce
Smart-Thinker.com - DotNetNuke Modules for Social Networks
PokerDIY.com - Simple Poker Leagues
John Mitchell
Veteran Member
Posts:4384

Avatar

Administrator
Send PM:Send Private Message

--
01 Mar 2010 03:05 PM
The first question depends on the location of the FriendlyUrl rewriter in relation to PageBlaster in the http modules list.
If it isn't under tabid, then it may be under "rod", or in the root of the cache for your example.

Files are cached to the disk at the same time they are cached in memory (unless they are already there). The disk cache never lags the memory cache, it is always kept current for when the page can't be found in memory.

Keep in mind that the page has to be requested by an un-authnticated user unless you are caching users.
Please Register to participate.

Active Forums 4.1
     
      
Powered by: Snapsis Software