Monday, 15 April 2013

caching - Safari and it's greedy greedy cache -



caching - Safari and it's greedy greedy cache -

now has come fair bit on here guess i'm looking explanation rather prepare (though ace), safari's / forwards cache horrifically greedy.

i've got issue form submits, loads interstitial modal window before moving on form action page. on safari cache strong button has modal open still making soul sad.

i'm hacking around dismissing modal , submitting form. on browser has half closed modal (it's bootstrap fades) carries on dismissing.

now know onunload="" refreshing page seems crazy. cache thing , want, specially on mobiles.

i guess question is:

why much more intense chrome , there anyway of forcing browser cache state instead of lastly state?

thanks

hah, greedy understatement! though, 99% of time, caching design behind safari ideal way handle page transitions on mobile device.

when go page a page b, , page a, don't want burden device (bandwidth, battery life) fetching resources , assets, when "paused" state between interactions, , "continue" when navigate back.

that's safari mobile does. utilize concept of page cache, keeps entire page live in memory, when navigate 1 another. reduces need fetch resources, , allows snappy interaction when clicking back.

that's great , all...but lead problems (such 1 brought up) - specifically, how distinguish between page suspended , 1 should have been destroyed?

thankfully, webkit provides pageshow , pagehide event tap page cache. in add-on firing when page shows or hides (similar onunload), has nifty ability indicate whether page persisted - or placed page cache.

while it's not perfect solution, check pageshow event persistence, , handle modal more straight (since know cached) hiding it.

if haven't already, take @ these 2 links here:

https://www.webkit.org/blog/427/webkit-page-cache-i-the-basics/ https://www.webkit.org/blog/516/webkit-page-cache-ii-the-unload-event/

they great job explaining page cache , include code samples of pageshow , pagehide event referenced earlier.

hope helps!

caching safari mobile-safari browser-cache

No comments:

Post a Comment