mojoPortal Feature Caching

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.
4/6/2010 5:51:17 PM
Gravatar
Total Posts 72

mojoPortal Feature Caching

Hi Joe,

I have developed a custom feature that pulls in a video feed from Vimeo and I want to cache the response.

I can do this using standard asp.net caching:

                var videos = (IList<Video>)Cache["VimeoFeed"];
                if (videos == null) {
                    videos = GetVideosFromVimeo(feedUrl);
                    Cache["VimeoFeed"] = videos;
                }

However, I notice that there is an Is Cacheable property on mojoPortal features. How should this be used? Is this just output caching?

Also I wondered whether perhaps you had some cache helper methods that I should use for caching objects and type casting etc?

Thanks,
Ben

4/7/2010 10:21:03 AM
Gravatar
Total Posts 18439

Re: mojoPortal Feature Caching

Hi Ben,

There is some explanation of caching on this thread. I have no helper class for you, I use my own helper class for my own things but it is not generic. I would be very careful about what you cache unless you expect your custom features to always run in a memory rich environment. If the object is really expensive to create and is used often then caching is a good idea, but be judicial.

Hope it helps,

Joe

4/7/2010 10:24:12 AM
Gravatar
Total Posts 72

Re: mojoPortal Feature Caching

Hi Joe,

Thanks for the reply.

The main reason is that I am calling a remote web service and have multiple instances on the page that use the same data. I don't really want two requests to the external service every time the page loads, plus the data is unlikely to change that often.

Thanks again,

Ben

4/7/2010 10:36:55 AM
Gravatar
Total Posts 18439

Re: mojoPortal Feature Caching

Hi Ben,

You might consider caching the data from the remote service into the database instead of server memory. This is what we do in the Feed Manager.

Hope it helps,

Joe

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