kontent-ai / delivery-sdk-php

Kontent.ai Delivery SDK for PHP
https://kontent.ai
MIT License
46 stars 15 forks source link

Detect stale content #81

Open alesk-kentico opened 5 years ago

alesk-kentico commented 5 years ago

Motivation

To improve response times Delivery API might provide stale content. Stale means that there is a more recent version, but it will become available later. This information is important for developers who implement caching because stale content should have a short TTL. Developers can inspect the value of the X-Stale-Content response header. 1 indicates that content is stale. If the header is not present or it has a different value, content is not stale.

Proposed solution

Extend response models with information whether content is stale. For consistency it is recommended to use a has stale content bool property with the proper case type.