3 ms·
Yeah, redirects to manifest entries makes the cache fail, but a 302 on a page the user visits (which is covered by a FALLBACK rule) is fine as long as it's to t
by jaffathecake 14y ago
Yeah, redirects to manifest entries makes the cache fail, but a 302 on a page the user visits (which is covered by a FALLBACK rule) is fine as long as it's to the same domain.
As for GOTCHA #9, I thought that was fixed in iOS4. But yeah also fails on Blackberry playbook and Andorid 3 & 4. Actually works on Android 2.3 (unless I'm mistaken), which isn't suprising as there are loads of regressions in the Android 3 browser.
- pavel_lishin 14y agoWe do mobile web development, and we like to scale down images to the appropriate size for any given phone. I was hoping to be clever, and instead of redirecting every user to a hardcoded image path (/illustration.17.503x302.jpg), to just redirect them to /illustration/17 - which would generate the properly sized image, and use a redirect to display it. Spent a few days on it. Worked great online. Then I discovered that putting /illustration/17 in the cache manifest made the entire thing fail, since it's a redirect. C'est la days of wasted work.
- sk5t 14y agoWell, why not return the proper content right away instead of redirecting? 'Course, you'd have to mark it with a private cache policy to prevent caching proxies from weirding things up.
- pavel_lishin 14y agoBecause then I'd have to open an image in PHP just to output it right back out. More work than just having Apache serve it.
- cstejerean 14y agoYou can use X-SendFile (or X-AccelRedirect) to have your PHP code tell Apache or Nginx which image to serve, without having to send a 302 to the browser.
- jaffathecake 14y agoBah. Nice idea though. So far we're using a double-sized sprite image whether you're on a high dpi device or not. Thankfully everything that supports appcache supports background-size, and the 'waste' of serving high-res sprites to phones that couldn't use them was negligible (it's basically just http://static.lanyrd.net/css/mobile-web/img/sprites5@2x.53a3a8cb.png http://static.lanyrd.net/css/mobile-web/img/sprites5@2x.53a3...).
- pavel_lishin 14y agoMost of the images we serve are loaded from a different server, and can be dynamically changed by editors, etc. Putting them into a sprite would probably be more work than it's worth.