Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I am working on a SharePoint 2013 Autohosted App that retrieves a lot of information from a remote system before displaying it to the user in the App. I'd like to create a caching layer to boost the performance of the App so that it is not repeatedly making requests for the same information.

I do have a database with the App, so I could always cache items in the database (faster than continually making requests, but not necessarily ideal).

What other caching options might work in an Autohosted SharePoint App that I could consider?

share|improve this question
    
This is one of the drawbacks of the Autohosted model. You only get a web role and a database, so if you want to cache, it is on you. There are different (perhaps better) cache strategies available if you choose provider hosted. Of course, that means you have to pay for it. But if the free offering doesn't meet your needs... –  Paul Schaeflein Feb 26 at 20:57
    
Yea, we may go the provider-hosted route if this doesn't pan out. :-/ –  John Chapman Feb 26 at 21:02

2 Answers 2

up vote 1 down vote accepted

Here is my interim solution: using HttpContext.Current.Cache.

There is a good helper class here: http://johnnycoder.com/blog/2008/12/10/c-cache-helper-class/.

If I don't get a better solution for this, I'll mark this as the answer.

share|improve this answer
    
I think that's a decent solution. I work with SP on-prem, so that would most likely be the way we would do it but I wasn't aware if it was usable with Office 365/AppFabric. Essentially you're caching on the server level, which is what I think you want. My hesitation to this solution is that it's ASP specific so if you wanted to at one point expand the app beyond using IIS you'd need a new solution. –  EHorodyski Feb 27 at 13:18

Can you deliver the data in chunks? Such as an infinite scroll or paging? If that's the case, I'd say just use AJAX and oData to grab more data as it's needed.

Also, how static is the content? Does it change often? If not you could always try browser caching or offline storage.

Simply put, we might need more information before we could better help out :-)

share|improve this answer
    
Basically when the backend (C#) code requests the data from the remote source, I'd like to cache it at this stage. So, that the next time the backend code runs, it grabs the cached version, if available, before requesting the remote data again. –  John Chapman Feb 26 at 20:39
    
I may try something like this: johnnycoder.com/blog/2008/12/10/c-cache-helper-class. Was hoping to find a way to use AppFabric, etc., in an AutoHosted App. –  John Chapman Feb 26 at 20:40
    
You know what? Why can't you cache it at the source level? If I'm not mistaken, that's how ASP sites would work as well. They cache the pages and when they run the request see if a new version is available. If not, bring in the cached version. So either way a request would be made to check if the content is new, so why cache it on receiving end? –  EHorodyski Feb 28 at 14:19

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.