CSPage is forcing immediate expiry of pages

rated by 0 users
This post has 10 Replies | 3 Followers

Top 10 Contributor
Male
Posts 2,373
Points 15,770
MVPs
Dave Posted: Fri, Apr 11 2008 7:02 AM

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?

  • | Post Points: 35
Top 50 Contributor
Posts 356
Points 5,155
Tabs replied on Mon, Apr 14 2008 8:40 AM

Anyone? This is causing a fair bit of load on the server at the moment.....

 

  • | Post Points: 5
Top 10 Contributor
Posts 3,424
Points 65,735
CS Developers
Ben Tiedt replied on Tue, Apr 15 2008 7:40 AM

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 Tiedt's Blog

  • | Post Points: 35
Top 50 Contributor
Posts 356
Points 5,155
Tabs replied on Tue, Apr 15 2008 7:48 AM

Thanks for the reply Ben. We'll have to do some testing with this and report back.

 

  • | Post Points: 5
Top 10 Contributor
Male
Posts 2,373
Points 15,770
MVPs
Dave replied on Tue, May 6 2008 11:56 AM

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?

  • | Post Points: 20
Top 10 Contributor
Posts 3,424
Points 65,735
CS Developers
Ben Tiedt replied on Thu, May 8 2008 11:32 AM

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)?

Ben Tiedt's Blog

  • | Post Points: 20
Top 10 Contributor
Male
Posts 2,373
Points 15,770
MVPs
Dave replied on Thu, May 8 2008 12:04 PM

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?

  • | Post Points: 5
Top 10 Contributor
Male
Posts 2,373
Points 15,770
MVPs
Dave replied on Thu, Jun 26 2008 8:02 AM

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?

  • | Post Points: 5
Top 10 Contributor
Male
Posts 2,373
Points 15,770
MVPs
Dave replied on Thu, Jun 26 2008 12:44 PM

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

The operation attempted requires that the current page inherit CSThemePage.

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

 

  • | Post Points: 5
Page 1 of 1 (11 items) | RSS
Powered by Community Server (Commercial Edition), by Telligent Systems

Copyright© 2008 Telligent Systems Inc. All rights reserved
CommunityServer.com  •  Telligent.com