We've recently moved from CS2.1 to CS2007 and noticed that whilst browsing the site that clicking back on the browser forces a refresh of the content from the server rather than issuing the page from the browser cache. Looking at the code, I can see that in CS2.1 you did not force expiration, whilst in CS2007 you do, this is causing increased unneccassary load.
Was there any reason for this change before I create a new base class myself and use that instead of CSPage?
The UKs best resource for the Golf, Bora, Jetta and Scirocco
Audi Forums, Galleries and Blogs
This change was made to ensure that dynamic content is not cached -- posts show up faster, changes are viewable faster, etc.
If this is not the desired behavior for your site, you can override the CSPage classes (in CS2007) and reset or disable the cache settings or (in CS2008) not use the base CSPage classes.
Bump!
Volkswagen Golf, Bora, Jetta and Scirocco Forums
Anyone? This is causing a fair bit of load on the server at the moment.....
*coughs*
Thanks for the reply Ben. We'll have to do some testing with this and report back.
Ben Tiedt: This change was made to ensure that dynamic content is not cached -- posts show up faster, changes are viewable faster, etc. If this is not the desired behavior for your site, you can override the CSPage classes (in CS2007) and reset or disable the cache settings or (in CS2008) not use the base CSPage classes.
Ben, i've overridden the CSPage class (CS2007.1) and removed the caching but the browser still gets the page from the server when clicking back in the browser, is there something else I need to look at?
Dave: Ben, i've overridden the CSPage class (CS2007.1) and removed the caching but the browser still gets the page from the server when clicking back in the browser, is there something else I need to look at?
Are you using your overridden page class in your theme pages (set via the Inherits property on the <%@ Page %> directive of each ASPX page)?
Ah, nope I just changed the pageBaseType in web.config to the new one. The classes that the pages inherit from don't seem to have any caching code within them?
Ben,
What is the easiest way to accomplish this? Forum pages inherit CSForumThemePage which derives from CSThemePageBase then CSPage. I had changed the pageBaseType in web.config to my own CSPage (without caching) but that will only work for webforms without the inherits attribute in the Page directive.
Is the only way to create my own CSForumThemePage, CSThemeBasePage and CSPage?
Ben Tiedt:you can override the CSPage classes (in CS2007
It looks like that is not possible. I've created my own CSForumThemePage, CSThemePageBase and CSPage classes, then changed the Inherits in filteredthreadlist.aspx to my new CSForumThemePage (Ukmkivs.CS.UI.CSForumThemePage), and get the fllowing error
Stack Trace:
[InvalidOperationException: The operation attempted requires that the current page inherit CSThemePage.] CommunityServer.Controls.CSControlUtility.GetCSThemePage(Page page) +104 CommunityServer.Discussions.Controls.ForumControlUtility.GetCurrentForum(Control currentControl) +327 CommunityServer.Discussions.Controls.ThreadList.get_DataSource() +104 System.Web.UI.WebControls.Repeater.ConnectToDataSourceView() +261 System.Web.UI.WebControls.Repeater.OnLoad(EventArgs e) +16 CommunityServer.Controls.PreTemplatedWrappedRepeaterBase.OnLoad(EventArgs e) +9 System.Web.UI.Control.LoadRecursive() +47 System.Web.UI.Control.LoadRecursive() +131 System.Web.UI.Control.LoadRecursive() +131 System.Web.UI.Control.LoadRecursive() +131 System.Web.UI.Control.LoadRecursive() +131 System.Web.UI.Control.LoadRecursive() +131 System.Web.UI.Control.LoadRecursive() +131 System.Web.UI.Control.LoadRecursive() +131 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1436
Copyright© 2008 Telligent Systems Inc. All rights reserved CommunityServer.com • Telligent.com