Question

While debugging an application earlier, I noticed in Web Inspector that it appears a new session storage object (table?) was being created on every request.

Screenshot:

enter image description here

You'll notice under Resources -> Session Storage there are multiple entries for test.localhost.

So, I got distracted from what I was actually meant to be debugging and went on a search to find out what was causing this. I narrowed it down to when Modernizr.js is included on the page.

I've been using the Html5 Boilerplate in various different applications so I went back to the bare boilerplate code and am getting the same behaviour there as well.

Note, the screen shot above is from the standard boilerplate code, nothing else.

So, is this standard behaviour? Is it something I should be concerned about? I've certainly not noticed any performance issues, even after using my applications for a few hours at a time.

For reference, I'm running:

Safari (5.1.2)
Lion (10.7.2)
Latest boilerplate code (commit 9feb29f4654540297e358454b821b2e29b848be8)

Was it helpful?

Solution

This is a bug in the developer tools in Safari, it has been fixed in more recent WebKit nightly builds.

It's not strictly caused by the inclusion of Modernizr, but by it's use of window.sessionStorage to cache its results for future use.

Any time you reload a page that uses window.sessionStorage (Modernizr or not) another entry appears on the Session Storage list in the dev tools. Same behaviour is observed using window.localStorage and WebSQL databases.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top