Short answer: Apple's archived documentation says the apple-app-site-association file must be no larger than 128 KB uncompressed. Files that list thousands of individual URLs can pass that limit. Replace the list with a few wildcard rules and the file usually drops to a few hundred bytes.
What is happening
AASA size limit: the 128 KB uncompressed ceiling for the apple-app-site-association file, introduced for apps on iOS 9.3.1 and later according to Apple's archived Handoff guide.
The limit applies to the uncompressed file, so gzip on your server does not help. Apple added the limit in April 2016 and it appears in the archived Handoff and App Search guides. Current Apple pages do not restate it, but it is still widely cited, and staying under it costs nothing.
curl -I https://example.com/.well-known/apple-app-site-associationshows aContent-Lengthabove 128 KB (if the server reports it uncompressed), or the downloaded file is larger than 128 KB on disk.- A file listing every product or article URL individually is the usual cause.
- Signing the file does not change the limit: the archived text says it applies "regardless of whether the file is signed".
Why does this happen?
The file grows because someone generates it from a sitemap or database, adding one rule per page. Wildcards were designed to avoid this.
- Generated path lists: one
pathsorcomponentsentry per URL. - Many app IDs repeated: the same long rule list copied under several
detailsentries. - Verbose comments: long
commentstrings on every rule add up.
How to confirm it
- Download the live file:
curl -s https://example.com/.well-known/apple-app-site-association -o aasa.json. - Check the uncompressed size:
wc -c aasa.json. Anything above 131,072 bytes (128 KB) is over the limit. - Download it with
curl -o aasa.jsonand check the size on disk, which is the uncompressed size.
How to fix it
- Group URLs by their path prefix, for example
/product/,/article/or/u/. - Replace each group with one wildcard rule.
*matches zero or more characters,?matches one character and?*matches one or more. - Put exclusions first. Apple says "the first match wins", so an
excluderule must sit above the broader rule it carves out. - Use a single
detailsentry with anappIDsarray when several apps share the same rules, rather than repeating the rules per app. - Shorten or remove
commentvalues. - Deploy, then reinstall the app on a test device to pick up the new file.
A file that covers thousands of product pages in three rules:
{
"applinks": {
"details": [
{
"appIDs": ["ABCDE12345.com.example.app", "ABCDE12345.com.example.app2"],
"components": [
{ "/": "/product/*/reviews", "exclude": true },
{ "/": "/product/*" },
{ "/": "/article/*" }
]
}
]
}
}
Compact files like this, with exclusions listed first, are easier to keep small. If some URLs then stop matching, see path not matched.