Merged in fix/destination-pages-cache-keys (pull request #1642)
Fix/destination pages cache keys * fix(destionationpages): add tag to citydatabycityidentifier that should invalidate when publishing city * Fixed building tag the same way and added comment why we need this extra tag Approved-by: Erik Tiekstra
This commit is contained in:
@@ -89,6 +89,19 @@ query GetDestinationCityPage($locale: String!, $uid: String!) {
|
|||||||
|
|
||||||
query GetDestinationCityPageRefs($locale: String!, $uid: String!) {
|
query GetDestinationCityPageRefs($locale: String!, $uid: String!) {
|
||||||
destination_city_page(locale: $locale, uid: $uid) {
|
destination_city_page(locale: $locale, uid: $uid) {
|
||||||
|
destination_settings {
|
||||||
|
city_denmark
|
||||||
|
city_finland
|
||||||
|
city_germany
|
||||||
|
city_norway
|
||||||
|
city_poland
|
||||||
|
city_sweden
|
||||||
|
location {
|
||||||
|
longitude
|
||||||
|
latitude
|
||||||
|
default_zoom
|
||||||
|
}
|
||||||
|
}
|
||||||
sidepeek_content {
|
sidepeek_content {
|
||||||
content {
|
content {
|
||||||
embedded_itemsConnection {
|
embedded_itemsConnection {
|
||||||
|
|||||||
@@ -232,6 +232,7 @@ const blocksRefsSchema = z.discriminatedUnion("__typename", [
|
|||||||
|
|
||||||
export const destinationCityPageRefsSchema = z.object({
|
export const destinationCityPageRefsSchema = z.object({
|
||||||
destination_city_page: z.object({
|
destination_city_page: z.object({
|
||||||
|
destination_settings: destinationCityPageDestinationSettingsSchema,
|
||||||
sidepeek_content: z
|
sidepeek_content: z
|
||||||
.object({
|
.object({
|
||||||
content: z.object({
|
content: z.object({
|
||||||
|
|||||||
@@ -29,6 +29,11 @@ export function generatePageTags(
|
|||||||
): string[] {
|
): string[] {
|
||||||
const connections = getConnections(validatedData)
|
const connections = getConnections(validatedData)
|
||||||
return [
|
return [
|
||||||
|
// This tag is added for the city list data on country pages to invalidate the list when city page changes.
|
||||||
|
generateTag(
|
||||||
|
lang,
|
||||||
|
`city_list_data:${validatedData.destination_city_page.destination_settings.city}`
|
||||||
|
),
|
||||||
generateTagsFromSystem(lang, connections),
|
generateTagsFromSystem(lang, connections),
|
||||||
generateTag(lang, validatedData.destination_city_page.system.uid),
|
generateTag(lang, validatedData.destination_city_page.system.uid),
|
||||||
].flat()
|
].flat()
|
||||||
|
|||||||
@@ -90,7 +90,7 @@ export async function getCityListDataByCityIdentifier(
|
|||||||
cityIdentifier,
|
cityIdentifier,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: `${lang}:city_list_data:${cityIdentifier}`,
|
key: generateTag(lang, `city_list_data:${cityIdentifier}`),
|
||||||
ttl: "max",
|
ttl: "max",
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user