Search code examples
iosbrowser-cache

Can I use full URLs in iOS cache manifest?


If I use a cache manifest for iOS Safari in order to cache pages offline, will it still work if I use a full URL, such as

https://example.com/content/folder/image.jpg

in the cache file, or do I have to use relative URLs?


Solution

  • The document clearly states:

    The URLs are file paths to resources you want to download and cache locally. The file paths should be relative to the location of the manifest file—similar to file paths used in CSS—or absolute.

    So it should be relative URL.

    But I also found an old link that says

    Resource URLs can be absolute or relative to the manifest file. Each URL must appear on a separate line.

    You should probably stick to the latest document and use relative URL only.