-1103 Error DomainNSURLErrorDomain Code-1103 resource exceeds maximum size iOS 13
Data Structures & Algorithms practice on Codemia
Step through 300+ coding interview problems with animated visualisers that show the data structure changing as the code runs. The Blind 75 are free.
Introduction
NSURLErrorDomain code -1103 usually appears when an iOS app tries to load more response data than the current request path can handle comfortably. In practice, it often means the app is treating a very large resource like a small one and needs a different download strategy.
What the Error Means
This error is commonly surfaced as “resource exceeds maximum size.” The key point is that the request did not fail because the URL was invalid or the server was unreachable. It failed because the transfer or in-memory handling of the response crossed a size threshold that the networking stack considered unsafe for that path.
Typical triggers include:
- Downloading a very large image, archive, or video with
dataTask. - Returning an unexpectedly huge JSON payload.
- Loading the entire response into memory before writing it to disk.
- Fetching content that should be paginated or streamed.
The error shows up more often on older devices or in memory-constrained conditions because the effective headroom is lower.
Prefer Downloading to Disk for Large Files
If the resource is large, switch from dataTask to downloadTask. A downloadTask writes the response to a temporary file instead of building a huge Data value in memory.
Here is a simple Swift example:
This is safer than:
That second pattern is fine for modest JSON responses, but it is a poor fit for large assets.
Reduce the Size of What You Request
Sometimes the fix is not on the client side alone. If the server returns far more data than the app needs, reduce the payload:
- Paginate list endpoints.
- Request thumbnails instead of full-size images for list views.
- Enable compression where appropriate.
- Support range requests for media or resumable downloads.
For example, if you only need a summary page:
Large “get everything” responses are a common reason for -1103.
Inspect the Response Before Processing It
You can often detect trouble early by checking response metadata:
This will not solve the issue by itself, but it helps confirm whether you are pulling back a response that should have been streamed or chunked.
Handle Large Media Deliberately
If the resource is an image, do not decode a massive original image on the main thread and then display it at thumbnail size. If it is video, avoid downloading the entire file into memory. If it is JSON, do not model a single endpoint around unbounded arrays.
The best fix is usually architectural: use the right transfer mode for the type and size of data you expect.
Common Pitfalls
The most common mistake is assuming all URLSession tasks are interchangeable. They are not. dataTask is for smaller responses you want in memory, while downloadTask is designed for larger transfers.
Another mistake is testing only on fast Wi-Fi with small sample files. Production traffic often includes slower networks and much bigger payloads than local fixtures.
Developers also focus only on the client and ignore the backend. If the server ships multi-megabyte JSON documents or original-resolution images to every screen, client-side fixes will only go so far.
Finally, do not swallow the original NSError. Log the failing URL, headers, and approximate response size. Without that context, -1103 is hard to diagnose.
Summary
- '
-1103usually means the app is trying to handle a response that is too large for the chosen request path.' - Use
downloadTaskfor large files instead ofdataTask. - Shrink payloads with pagination, compression, or smaller asset variants.
- Check headers such as
Content-Lengthwhen diagnosing the issue. - Treat the problem as both a networking choice and a payload-design problem.
Related reading
- Use the inherited flag, or Remove the build settings from the target. CocoaPod Swift3 pod update error
- -didSelectRowAtIndexPath not being called
- 2D cross-platform game engine for Android and iOS?
- 2D cross-platform game engine for Android and iOS?
- Why is the Android emulator so slow? How can we speed up the Android emulator?
- ✔ Checkmark selected row in UITableViewCell
- A complete solution to LOCALLY validate an in-app receipts and bundle receipts on iOS 7
- A declaration cannot be both 'final' and 'dynamic' error in Swift 1.2
.png&w=3840&q=75)
Tackling System Design Interview Problems
A short course that equips you with the skills to approach system design interviews methodically.
Start the free courseNo course covers this one yet
Basis Lab writes one for you from a sentence about what you want to be able to do, then teaches it and checks you understood. Your first course is free.
Build my courseData Structures & Algorithms practice on Codemia
Step through 300+ coding interview problems with animated visualisers that show the data structure changing as the code runs. The Blind 75 are free.