# FLV cache headers?

**URL:** <https://www.ruby-forum.com/t/flv-cache-headers/215303>\
**Category:** NGINX\
**Created:** [December 29, 2011, 8:26pm UTC](https://www.ruby-forum.com/t/flv-cache-headers/215303 "2011-12-29T20:26:05Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![dubstep](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/cdc98d/32.png) [@dubstep](https://www.ruby-forum.com/u/dubstep)\
**Post date:** [December 29, 2011, 8:26pm UTC](https://www.ruby-forum.com/t/flv-cache-headers/215303/1 "2011-12-29T20:26:05Z")

</div>

Can FLV files be cached to the browser? I’m passing the “expires max”  
tag  
which looks like its working as this is the response header:

HTTP/1.1 200 OK  
Server: nginx/1.1.12  
Date: Thu, 29 Dec 2011 19:13:09 GMT  
Content-Type: video/x-flv  
Content-Length: 8919417  
Last-Modified: Thu, 29 Dec 2011 04:13:19 GMT  
Connection: keep-alive  
Expires: Thu, 31 Dec 2037 23:55:55 GMT  
Cache-Control: max-age=315360000  
Accept-Ranges: bytes

but when I look in Firebug, there’s no cache header and reloading the  
page, well, reloads the file.

Can anyone explain? are FLV files not cacheable by browsers as they  
are considered streams?

Thanks

---

<div class="post-metadata">

**Author:** ![iberci](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/i/a3d4f5/32.png) [@iberci](https://www.ruby-forum.com/u/iberci)\
**Post date:** [December 31, 2011, 12:04pm UTC](https://www.ruby-forum.com/t/flv-cache-headers/215303/2 "2011-12-31T12:04:24Z")

</div>

Hello!

On Thu, Dec 29, 2011 at 02:25:35PM -0500, Ilan B. wrote:

> Expires: Thu, 31 Dec 2037 23:55:55 GMT  
> Cache-Control: max-age=315360000  
> Accept-Ranges: bytes
> 
> but when I look in Firebug, there’s no cache header and reloading the  
> page, well, reloads the file.
> 
> Can anyone explain? are FLV files not cacheable by browsers as they  
> are considered streams?

I suspect the problem isn’t browsers, but Flash.

Maxim D.

---

<div class="post-metadata">

**Author:** ![iberci](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/i/a3d4f5/32.png) [@iberci](https://www.ruby-forum.com/u/iberci)\
**Post date:** [December 31, 2011, 12:50pm UTC](https://www.ruby-forum.com/t/flv-cache-headers/215303/3 "2011-12-31T12:50:13Z")

</div>

Afaik Flash _should_ support that way of caching, at least if not  
requested via ?start=xx (when seeking). I think you should not set a  
caching value of more than a year in max-age and Expires headers (it  
barely makes sense anyway).

Also its probably a good idea to use the same caching value in both  
Expires and max-age headers, so you have consistent behavior on the  
client side. In this request you set max-age to 10 years and Expires to  
2037 (26 years).

Date: Thu, 29 Dec 2011 14:25:35 -0500  
Subject: FLV cache headers?  
From: removed\_email\_address@domain.invalid  
To: removed\_email\_address@domain.invalid

Can FLV files be cached to the browser? I’m passing the “expires max”  
tag which looks like its working as this is the response header:

HTTP/1.1 200 OK  
Server: nginx/1.1.12  
Date: Thu, 29 Dec 2011 19:13:09 GMT  
Content-Type: video/x-flv  
Content-Length: 8919417  
Last-Modified: Thu, 29 Dec 2011 04:13:19 GMT  
Connection: keep-alive  
Expires: Thu, 31 Dec 2037 23:55:55 GMT  
Cache-Control: max-age=315360000  
Accept-Ranges: bytesbut when I look in Firebug, there’s no cache header  
and reloading the page, well, reloads the file.  
Can anyone explain? are FLV files not cacheable by browsers as they are  
considered streams?

Thanks
