Origin shielding request flow
Without shielding, every CDN edge that misses cache can request the same manifest, segment, or video file from the origin. A live event or a popular VOD release can create a large number of concurrent origin requests. With Origin Shielding, edge servers pull missed objects through one shield location. The shield serves a cached copy when it has the object, and otherwise makes one origin request that other edges reuse.The origin still serves the first request for uncached or expired content.
Live events
A live event with a large concurrent audience requests the same playlists and segments at the same time from different regions. Origin Shielding concentrates those repeated edge misses on the shield, so the origin receives one pull instead of a pull from every edge.VOD libraries
Hot titles are usually served from edge cache. A cold title, or a title evicted after it stops being hot, can miss on edges in different regions. One miss warms the shield cache, so other edges reuse that copy. Repeated misses from several regions show up as a low cache hit ratio. That is a reason to enable Origin Shielding for a live event or a VOD library.Cache lifetime for video
For live streaming, use a short cacheable TTL for manifests and a longer TTL for segments when the workflow allows it. VOD files and segments need a TTL long enough for later requests to hit the shield.REST API
Set a shield location on the CDN resource that delivers the video. The sequence lists locations, saves one, reads the resource, and clears the setting. In the Gcore Customer Portal, the same location is set from origin shielding.An API token is required, along with the ID of the CDN resource that delivers the video.
Shield locations
Select the shield location closest to the video origin. A locations list returns its id, datacenter, city, and country, and that id is the value forSHIELDING_POP.
- Python SDK
- Go SDK
- curl
Location update
A shielding update setsshielding_pop to a location id and returns that id. The id has to be one returned by the locations list.
- Python SDK
- Go SDK
- curl
An unknown location id returns HTTP 400 with the message
Invalid pk "999999999" - object does not exist.Resource fields
Read the CDN resource after the update.shielded is true when Origin Shielding is enabled, and shield_dc is the datacenter name of the location that was saved.
shield_enabled is read-only and reports whether the shield is active and working. The update does not write that field, so confirm the saved setting with shielded and shield_dc.
- Python SDK
- Go SDK
- curl
Cleared location
The same update setsshielding_pop to null. The resource then reports shielded as false and shield_dc as null.
- Python SDK
- Go SDK
- curl