5

Possible Duplicate:
While making a post with an image, the image flickers in and out of the preview while I type

Kind of a minor issue, but in one of my posts earlier on SU I inserted an image while I was writing my question so I could make my point clearer. After the image had been inserted after every keypress the image was re-downloaded (as shown in my IE Status Bar.) enter image description here

Just a minor one.

(IE8, Windows 7, 32-Bit). Seen on M.SO and SU.)

6
  • In the YouTube video from that other question, I do not see the Chrome network/download indicator turning around. But it might still be related indeed. Tombull, can you test with Safari or Chrome (for their WebKit Web Inspector), or in Firefox with the Firebug add-on, to check if you see network activity?
    – Arjan
    Aug 23, 2011 at 17:00
  • (Tombul, see the network panel in Chrome's developer tools, a.k.a. Web Inspector in Safari. That will also allow you to see the HTTP headers. Also note chrome://view-http-cache/http://i.stack.imgur.com/cmXJg.png in Chrome.)
    – Arjan
    Aug 23, 2011 at 18:45
  • @Arjan, I've checked with the latest version of FireFox with FireBug and have been unable to reproduce (although possible I've been looking in the wrong place :/).
    – tombull89
    Aug 23, 2011 at 19:29
  • When looking at Firebug's Net panel, and then expanding the row that fetches the image (hit Ctrl-F5 to reload, if you don't see that row, or if it says 304 Not Modified), do you see (kind of) the same Cache-Control and Expires headers that Web-Sniffer gets?
    – Arjan
    Aug 23, 2011 at 20:49
  • (As an aside: Firefox and Firebug don't need CamelCase spelling.)
    – Arjan
    Aug 23, 2011 at 20:50
  • @Arjan, both FireBug and Cache-Control both report "control" and "expires" headers of max-age=31536000 and Thu, 23 Aug 2012 08:02:50 GMT (save a few seconds).
    – tombull89
    Aug 24, 2011 at 8:06

1 Answer 1

6

As you make changes to the post, the Markdown preview is completely (and intentionally) rerendered on the fly. This means that the image is reinserted into the DOM many times over, so the browser does have to pull up the image more than once.

Typically the image will be in the cache after the first load though, so it shouldn't have to make an actual request for it on subsequent updates, and the process shouldn't be noticeable. I was finally able to reproduce this, but I had to use Fiddler to deliberately create the scenario (and even then I had trouble for a bit, for some reason).

8
  • Indeed, the image should be in the cache for 31,536,000 seconds (being 1 year). Are you using some InPrivate mode, Tombull?
    – Arjan
    Aug 23, 2011 at 16:32
  • @Arjan, nope. Normal IE (no InPrivate or no-add-on mode)
    – tombull89
    Aug 23, 2011 at 16:33
  • Very odd, @tombull89. When downloaded once, I see no network activity whatsoever in Chrome's web inspector when using ![Some diagram](http://i.stack.imgur.com/cmXJg.png) and adding text above or below it. (Well, there's a heartbeat Ajax call, but that's all.)
    – Arjan
    Aug 23, 2011 at 16:39
  • @tombull89 You aren't behind any sort of proxy either, right?
    – Tim Stone
    Aug 23, 2011 at 18:27
  • Tim, did you disable caching using Fiddler? @tombull, I guess not as much more would probably break, but: any chance your clock is one year fast...?
    – Arjan
    Aug 23, 2011 at 18:37
  • @Arjan Yeah, I did.
    – Tim Stone
    Aug 23, 2011 at 18:49
  • @Tim Stone, nope, no proxy.
    – tombull89
    Aug 23, 2011 at 19:31
  • @Arjan, nope I'm not in the future either.
    – tombull89
    Aug 23, 2011 at 19:31

Not the answer you're looking for? Browse other questions tagged .