0

I need to show an HTML page in an UIWebView under Retina and non-retina displays.

Moreover I'd like to use the cache manifest functionality from HTML5. But I want to have two different cache manifest files with links to Retina and non-retina images.

Can I use any logical statements for a cache manifest? Or can I change manifests files dynamically?

misho
  • 1,195
  • 6
  • 16
  • 29

1 Answers1

1

You could have an index.html that uses some simple javascript to check the user-agent, and then do a redirect to a index-nonretina.html and index-retina.html. Each of those files could contain a unique cache manifest file.

You could also create a dynamic cache manifest file on the server side using PHP, Node or whatever. Check the user agent string in the request object and change what you send back accordingly. Just make sure you set the MIME type to "text/cache-manifest".

Greg

Greg Wilson
  • 2,380
  • 2
  • 15
  • 14