Permalink
Branch: master
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
42 lines (26 sloc) 1.61 KB
title
Cache Invalidation

Storyblok uses a CDN in front of the API to deliver your content in the fastest way possible. If you're using the Storyblok Content Delivery API directly in your client application it is recommended to use a backend version number or the versions parameter provided by the /v1/cdn/spaces/me?token=access_token call.

Recommended: Client Side

  1. Request the resource /v1/cdn/spaces/me to get the space.version property
  2. Append the space.version to all your subsequent calls of the endpoint /v1/cdn/stories

Recommended: SSG / Server Side

  1. Generate a timestamp (once on a server, not on every request/client load)
  2. Append your timestmap to all your subsequent calls of the endpoint /v1/cdn/stories

Also server side applications application can use the space.version option. Storing the version string to a file and reusing this timestamp will guarantee you the latest version with optimal speed. You can either use the Storyblok Webhooks or Storyblok JavaScript Events to update your version file.

;examplearea

Example Request

Example Response

{
  "space": {
    "name": "Space A",
    "domain": "http://example.storyblok.com",
    "version": 1541863983
  }
}

Use the timestamp as cv: