Edge does not play video if server returns 304
Asked Answered
B

1

10

I've found that Edge doesn't work when playing videos for the 2nd time. My app is using a default <video> tag and Edge is sending an If-Modified-Since header when it loads the video for the second time. If my server returns a 304 Not-Modified it doesn't work. When I change it to return the complete video it works.

Anyone that can verify this behavior? Am I doing something wrong, should I add other things in my 304 response in order to make it work?

Btw I saw that other browsers like Chrome and Firefox never send the If-Modified-Since when loading the video.

Balaklava answered 11/3, 2018 at 21:21 Comment(4)
At first glance this seems like a caching bug in Edge. With most servers it should be pretty easy to modify them to ignore the header on certain resources - so that can serve as a workaround if the video is not cacheable (i.e. too large).Gladdy
Is the video streamed over https? Can you try over http as well if so to see if there is any difference?Manganite
@Gladdy that is what I eventually did - disable caching for edgeBalaklava
@AlexKeySmith it is over http have not been using https (yet)Balaklava
P
4

You may take a look on this stackexchange question, where you can read:

According to this article, these are the situations browsers will request using If-Modified-Since:

  • The cached entry has no expiration date and the content is being accessed for the first time in a browser session
  • The cached entry has an expiration date but it has expired
  • The user has requested a page update by clicking the Refresh button or pressing F5

[...]

One thing that may help is adding "public" to the cache control header, i.e. Cache-Control: public, max-age=31536000.

You may also add immutable, so could you try with:

Cache-Control: public, max-age=31536000, immutable
Palpate answered 22/3, 2018 at 18:22 Comment(1)
thanks stefani I will try and check if this is making a differenceBalaklava

© 2022 - 2024 — McMap. All rights reserved.