Marcuswestin/WebViewProxy. File System vs Core Data: the image cache test. Code for this project is on GitHub While doing a full re-write of Droplr's iOS app for the 2.0 launch, I couldn't find any good file/image caches out there had a particular feature I really wanted: extending item expiration whenever it's touched. I set out to write my own — which wasn't that much of a challenge — but somewhere along the process I had this crazy idea that perhaps (SQLite-backed) Core Data would be a much better tool for the job: No mismatch between cache index file and actual data stored;Trivial querying;Nice and easy object oriented code.
Being a structured data store with Object-Relational Mapping, it's only logical that it would be slower. Just how slower is what I wanted to find out. One protocol to rule them all The number one goal with this pet project was that both the file system and Core Data cache implementations had to present the exact same signature to the programmer, while being consistent in the way they work. Super simple stuff... Correctness check Woah! Iphone - Disk space for downloaded files in ios app. ASIHTTPRequest example code - All-Seeing Interactive. Creating and running requests Creating a synchronous request The simplest way to use ASIHTTPRequest. Sending the startSynchronous message will execute the request in the same thread, and return control when it has completed (successfully or otherwise). Check for problems by inspecting the error property.
To get the response as a string, call the responseString method. Creating an asynchronous request Does the same thing as the previous example, but the request runs in the background. Note that we set the delegate property of the request so we can receive notification when the request completes or fails. This is the simplest way to create an asynchronous request, and it will run in a global NSOperationQueue behind the scenes. Using blocks As of v1.8, we can do the same thing using blocks, on platforms that support them: Note the use of the __block qualifier when we declare the request, this is important!
Using a queue Handling success and failure for multiple requests in delegate methods. Iphone - What major ASIHTTPRequest features is AFNetworking missing. Pull Request #25: AFURLCache - disk cache for iOS by steipete · AFNetworking/AFNetworking. Ptshih/PSURLCache. ASIWebPageRequest - a new class for downloading complete webpages - All-Seeing Interactive. Saturday 3 July 2010 ASIWebPageRequest is a new experimental addition to the ASIHTTPRequest family. It can be used to download a complete webpage, including external resources like images and stylesheets, in a single request. Once a web page is downloaded, the request will parse the content, look for external resources, download them, and insert them directly into the html source using Data URIS.
You can then take the response and put it directly into a UIWebView / WebView on Mac. Why do this? There are a number of advantages: You have access to the whole page (including external resources) as a single string. How it works ASIWebPageRequest works by downloading its URL, and looking at the content type. HTML documents If it gets a content type that looks like HTML / XHTML, it will parse the page as HTML. CSS documents ASIHTTPRequest handles CSS documents in a similar way, but replaces URLs with data URLs using a simple find and replace.
Limitations Try it out. Rs/SDURLCache. Performance Research, Part 5: iPhone Cacheability – Making it Stick. This article, co-written by Wayne Shea, is the fifth in a series of articles describing experiments conducted to learn more about optimizing web page performance (Part 1, Part 2, Part 3, Part 4). You may be wondering why you’re reading a performance article on the YUI Blog. It turns out that most of web page performance is affected by front-end engineering, that is, the user interface design and development. At MacWorld 2008, Steve Jobs announced that Apple sold 4 million iPhones to date, that’s 20,000 iPhones sold every day. Net Applications reports that total web browsing on iPhone is up at 0.12% for December 2007, topping the web browsing on all Windows Mobile devices combined. Apple’s iPhone has changed the game for many users browsing the web on a mobile device. Web developers can now create functionally rich and visually appealing applications that run within the iPhone’s version of the Safari Mobile web browser.
Cache Hit or Miss? Expires: Thu, 15 Apr 2010 20:00:00 GMT Yahoo!