Why do browsers inefficiently make 2 requests here?

前端 未结 9 2166
-上瘾入骨i
-上瘾入骨i 2021-02-13 14:48

I noticed something odd regarding ajax and image loading. Suppose you have an image on the page, and ajax requests the same image - one would guess that ajax requests would hit

9条回答
  •  离开以前
    2021-02-13 15:47

    The helpful folks at Mozilla gave some details as to why this happens. Apparently Firefox assumes an "anonymous" request could be different than normal, and for this reason it makes a second request and doesn't consider the cached value with different headers to be the same request.

    https://bugzilla.mozilla.org/show_bug.cgi?id=1075297

提交回复
热议问题