Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Edge does not play video if server returns 304

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.

like image 380
Andre Avatar asked Mar 11 '18 21:03

Andre


1 Answers

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
like image 151
A STEFANI Avatar answered Sep 23 '22 22:09

A STEFANI