sulu / SuluHeadlessBundle

Bundle that provides controllers and services for using Sulu as headless content management system
MIT License
45 stars 25 forks source link

Add cachelifetime or valid until to page response #99

Closed alexander-schranz closed 1 year ago

alexander-schranz commented 2 years ago

When using block settings to control when a block should go online, the cachelifetime header is set to the time when it is valid. This information would be great for application when they have there own caching so they know when they need to request the headless api again.

We currently implemented a listener which converts the TTL to a timestamp, else when just returning the TTL it would need to be calculated by AGE - CustomTTL header.

Maybe there are standard way (header) for things like gatsby or other JS libraries when a headless endpoint should be requested again to regenerate a site.

alexander-schranz commented 1 year ago

I will close this issue as written it is still possible for edge cases to calculate this values out of Age - CustomTTL.