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?
LVL 1
BRMarketingAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
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
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
HTML

From novice to tech pro — start learning today.