• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 57
  • Last Modified:

What is the best way to cache a webm video file with Html5?

Dear Experts,
I use a small video on my page, and I want my users to cache that video on their computer.
I mean, I don't want my users to download that video every time they visit my page.
is it done by default or should I use some cache control like below?

<meta http-equiv="pragma" content="Cache">

What is the best way to cache a webm file with Html5?
0
BR
Asked:
BR
  • 2
  • 2
1 Solution
 
Ayoub RouziCeo & CoFounderCommented:
BR,

Add this  block
<IfModule mod_expires.c>
ExpiresActive On
ExpiresByType video/mp4 "access 1 month"
ExpiresByType video/webm "access 1 month"
</IfModule>

Open in new window


Complete also your meta:
<meta http-equiv="cache-control" content="max-age=0" />
<meta http-equiv="cache-control" content="no-cache" />
<meta http-equiv="expires" content="0" />
<meta http-equiv="expires" content="Tue, 01 Jan 1980 1:00:00 GMT" />
<meta http-equiv="pragma" content="no-cache" />

Open in new window

0
 
BRMarketingAuthor Commented:
Dear Ayoub Rouzi, I want to cache the file,
i think you misunderstood, or I wasn't clear about my question.

what I want is to cache the file so that my users do not download it every time they visit my page.
0
 
Ayoub RouziCeo & CoFounderCommented:
Yes i totally understand your point.

After you configure the appliance to cache videos, it caches the videos viewed by your users. You can also use the pre-population option to fetch selected videos from the local video server in anticipation of later use.
0
 
BRMarketingAuthor Commented:
thank you Ayoub Rouzi,
you suggest that, if I use your first code in my .httaccess file, if the video is downloaded once, the browser call it from the cache? right?
it won't download it again until I say so? apparently in your code it is 1 month.
<IfModule mod_expires.c>
ExpiresActive On
ExpiresByType video/mp4 "access 1 month"
ExpiresByType video/webm "access 1 month"
</IfModule>

Open in new window

0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now