Better video performance in Web Stories

74 views
Skip to first unread message

Ryan Warrender

unread,
Aug 26, 2021, 12:11:14 PM8/26/21
to web-stories...@amp.dev

Hello everyone,


Good news - Google now provides support for video caching to all Web Stories. This feature can help reduce serving costs, less waiting, and a better end reader experience. 


If you opt-in, Google will try to serve videos from the Google cache before falling back to your site’s hosting, potentially reducing your video hosting costs by up to 99%. 

Creation Tool Implementation 

If you are a creation tool that implements this feature we recommend giving the users an option to opt-in to Google’s Video Cache . We encourage you to make the benefits clear to users (ie: potentially reducing hosting costs and enhancing the end user experience). 

Opt-In Instructions

If you opt in, Google will try to serve videos from the Google cache before falling back to your site’s hosting, potentially reducing your video hosting costs by up to 99%. 

To get started using the Google Cache to serve video, you’ll need access to the HTML of your Stories.

To opt-in on the Google cache:

Mark the amp-video with the attribute cache="google".

The sources should be specified as a source child component and not through the src attribute of amp-video. Use 720p videos or higher to take advantage of all the video transcodes and adaptive bitrate algorithms.

Example:

<!-- Enable caching on this video via the attribute opt-in -->

<amp-video cache="google">

  <source src="source1.mp4">

</amp-video>

Code language: HTML, XML (xml)

If the opt-in was successful, you will be able to see on the browser network tab a request to https://*.cdn.ampproject.org/mbv/s/* that returns a JSON with an empty list of sources (since the cache missed this video). 

 

Please let us know if you launch this feature and you can reach out to us on Github or Slack via the #amp-story channel to connect.


- Web Stories Team




Ryan Warrender | Product Manager, Google | warr...@google.com | Web Story Design Tips


Reply all
Reply to author
Forward
0 new messages