0

I have a mobile site for which I am creating a native app. I am mainly using a UIWebView to load the pages from my mobile site in the app. I want to make the app more responsive. The site isn't heavy on images but has a few HTML forms and stuff. It is mainly a ticket booking system, where you login, book tickets, cancel tickets, etc.

Do I need to use an NSURLCache for such an app? The html forms on the mobile site seldom change. Is there a way to cache the html pages. What is the recommended way of implementing this.

tbag
  • 1,268
  • 2
  • 16
  • 34

1 Answers1

0

There is no need for a NSURLCache as your app probably won't work offline. Using an NSURLCache could reduce the amount of requests made to your webserver but also increases the chance that the app uses outdated HTML.

To reduce the bandwidth and load on your server, you might want to use the appropriate NSURLRequestCachePolicy of the NSURLRequests. And then make sure you configure your webserver appropriately. All the NSURL*-Classes use an internal cache according to the Cache Policy and decide upon the metadata (http-headers received by the server) of each file to determine if it has to be loaded from network or not.

mahal tertin
  • 3,239
  • 24
  • 41