Enabling Caching for HTML control?

This forum is only for questions or discussions about working with the mojoPortal source code in Visual Studio, obtaining the source code from the repository, developing custom features, etc. If your question is not along these lines this is not the right forum. Please try to post your question in the appropriate forum.

Please do not post questions about design, CSS, or skinning here. Use the Help With Skins Forum for those questions.

This forum is for discussing mojoPortal development

This forum is only for questions or discussions about working with the mojoPortal source code in Visual Studio, obtaining the source code from the repository, developing custom features, etc. If your question is not along these lines this is not the right forum. Please try to post your question in the appropriate forum.

You can monitor commits to the repository from this page. We also recommend developers to subscribe to email notifications in the developer forum as occasionally important things are announced.

Before posting questions here you might want to review the developer documentation.

Do not post questions about design, CSS, or skinning here. Use the Help With Skins Forum for those questions.
This thread is closed to new posts. You must sign in to post in the forums.
5/7/2009 9:29:27 PM
Gravatar
Total Posts 34

Enabling Caching for HTML control?

Joe,

Is there a way to cache the html content on the server? It appears that for every request for a page that containst mojo html control the control goes to the DB. IS there some configuration setting for caching the html content on the server or woud I have to extend it myslef?

5/8/2009 6:35:05 AM
Gravatar
Total Posts 18439

Re: Enabling Caching for HTML control?

Hi,

Originally all of the features supported using the cache but over time as more ajax was used in features caching became inappropriate for those features that use ajax and do ajax postbacks. My intention is to extend the feature definitions to add a property indicating whether they are cacheable so I can show or hide the cache settings accordingly. But for the short term I have hid the cache setting on feature instances by default because most users should not use caching at all.

The Html content feature does support caching and you can enable it so you will see the cache setting on the General tab under feature instance settings (ie the gear icon next to the title of a feature instance). Just add this to Web.config (or ideally user.config)

<add key="DisableContentCache" value="false" />

Then you will see the cache setting appear. For features that do ajax postbacks like the blog, feed manager, polls, and others, I recommend you leave the cache time as 0 which means no cache. For the html feature it is perfectly fine to use it and set whatever cache value you like.

The reason I say most users should not use the cache at all even for features like html which can use it, is because most users (I think) are using mojoPortal in shared hosting, often very cheap shared hosting with very little ram and in these environments you shouldnot try to use cache because it consumes memory. If you have very little memory and you try to use caching you end up exhausting the memory which forces frequent recycling of the application causing bad performance.

Hope it helps,

Joe

You must sign in to post in the forums. This thread is closed to new posts.