Hi @gabriel, thanks. @rneimesh and me are working together on this. Would we be able to get your advice on what the “best practice” is for the following situation?
In Contentful, we have an entry type for articles. Each article has all fields localized, including a “slug” field that indicates what the permalink is for each language. On our website, we have an article template (e.g. domain.tld/en/my-example-article, domain.tld/es/mi-articulo-de-ejemplo, etc…) which calls the Contentful API to retrieve the entry in the selected language (i.e. with locale parameter). But we also need to get every slug for that article in all languages in order to populate hreflang alternate tags for SEO
Right now, the only way we can achieve this is to do two API calls: one for the entry in the selected language, then a separate one just for the slug field in all locales. This seems very inefficient and adds unnecessary latency. We also don’t want to get the entry in all languages (to avoid the two API calls), because the payload of that request would be huge.
Is there a better way to achieve this?
I would guess this is a very common use case for any website dealing with localized content, and one that would be ideal if Contentful had a more efficient way to achieve the desired result.