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.
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.
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
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
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
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.