我们已经使用通用链接很长时间了。今天我添加了一个路径到AASA文件中(我们称之为sub2)。即使重新安装应用程序,该路径也无法被应用程序识别。
当我进行调试时,我注意到应用链接服务正在获取该文件,但请求没有进入我们的服务器。该服务确实获得了旧的AASA文件,因此似乎苹果的CDN正在缓存此文件。
调试:
更新:发现我们可以直接使用以下URL查询CDN:https://app-site-association.cdn-apple.com/a/v1/yourdomain.com => 此请求返回旧文件,而原始文件(如Apple-From标头中所述)更新了!根据Age标头,文件只有几分钟的历史。
更新2:问题终于解决了,我只能猜测CDN缓存现在已经刷新。我确保我们的服务器现在发送一个Cache-Control: no-store标头,看起来这使得苹果CDN现在将其缓存一小时(max-age: 3600),但在那个小时后它会被有效地刷新。
请注意,在突然出现的解决方案之前,CDN返回的文件年龄只有几分钟,最大年龄为1800,所以我仍然不太清楚为什么在服务器文件更新后40个小时它仍然没有提供新内容。
至少对于未来遇到类似问题的人来说,CDN URL是调试的很好的起点:https://app-site-association.cdn-apple.com/a/v1/yourdomain.com。
当我进行调试时,我注意到应用链接服务正在获取该文件,但请求没有进入我们的服务器。该服务确实获得了旧的AASA文件,因此似乎苹果的CDN正在缓存此文件。
调试:
AASA file is valid: tested with Branch Validator as well as the new URL in Apple's appsearch-validation-tool
{ "applinks": { "apps": [], "details": [ { "appID": "redacted", "paths": [ "/main/*", "/sub1/*", "/sub2/*", "/pagex-*" ] } ] }, "activitycontinuation": { "apps": [ "redacted" ] } }
Apple tool: tested https://redacteddomain/sub2/something Link to Application: Passed Universal true ...
File is not cached at our side/Cloudflare: above validators confirm this but to be sure I also purged the cache
Iphone console shows the AASA file is being fetched:
Beginning data task AASA-64DCD3xx-xxxxx { domain: xx….xx, bytes: 0, route: cdn }
Created a sysdiagnose file on the Iphone, it show the AASA file is fetched at this very timestamp but the contents is the old content:
Service: applinks App ID: (redacted) App Version: 2.3.4 App PI: <LSPersistentIdentifier 0x101579cc0> { v = 0, t = 0x8, u = 0x11c0, db = 49C449xx-xxxx, {length = 8, bytes = 0xc011000000000000} } Domain: (redacted) Patterns: {"/":"/main/*"}, {"/":"/sub1/*"}, {"/":"/pagex*"} User Approval: unspecified Site/Fmwk Approval: approved Flags: Last Checked: 2021-07-13 18:45:00 +0000 Next Check: 2021-07-18 18:36:18 +0000
更新:发现我们可以直接使用以下URL查询CDN:https://app-site-association.cdn-apple.com/a/v1/yourdomain.com => 此请求返回旧文件,而原始文件(如Apple-From标头中所述)更新了!根据Age标头,文件只有几分钟的历史。
更新2:问题终于解决了,我只能猜测CDN缓存现在已经刷新。我确保我们的服务器现在发送一个Cache-Control: no-store标头,看起来这使得苹果CDN现在将其缓存一小时(max-age: 3600),但在那个小时后它会被有效地刷新。
请注意,在突然出现的解决方案之前,CDN返回的文件年龄只有几分钟,最大年龄为1800,所以我仍然不太清楚为什么在服务器文件更新后40个小时它仍然没有提供新内容。
至少对于未来遇到类似问题的人来说,CDN URL是调试的很好的起点:https://app-site-association.cdn-apple.com/a/v1/yourdomain.com。