Headless Server Developer Manual / Version 2201
Table Of ContentsThe time at which a published content should be visible to the customer can be controlled by validity or visibility. For more information see Section 4.6.14, “Time Dependent Visibility” in Studio User Manual.
To enable time dependent visibility, you have to pass a request header with the view date to the Headless Server. Note that this is only possible in preview mode.
The view date request header is passed as:
- Header Name:
X-Preview-Date
- Value: Date object in HTTP Date Header standard format, see RFC 7231 for specification
The RequestDateInitializer
evaluates the view date header
and either sets the passed date, or, if
not available, the current date as request attribute. The view date is
then set in the GraphQL context and can be retrieved via ContextHolder#getViewDate()
.
The validity check of content items is performed in the
ValidityDateFilterPredicate
which is configured in CaasConfig
.
The visibility of content items is checked in the PageGridAdapter
.