Filtering requests based on a specific language

Is there a way to filter the request to a specific language?

We thought it might be possible to use GraphQL but it doesn’t look like we can, based on what we’ve seen/tried. Did we miss something? Is there any other way to achieve this behavior? Thanks!

I am not sure what exactly you mean…

We support 13 languages in our app, and because of that, each post contains 13 different translations. This results in a high traffic (for example, this month we had 70GB out of the 100GB that is available in our plan). We’re concerned that once we add this content to another product/website, this will increase.

We want to limit the traffic by requesting per specific language rather than all of the languages at once or if you have other ideas how to reduce the traffic usage?

I really doubt that the traffic comes from the content itself. It is more likely that it comes from some assets. You can download the logs and analyze them using the CLI.

If you have traffic problems I also recommend to use caching, especially for things like headers and footers.

But about your answer.

In GraphQL you have to define the languages you want

e.g.

query {
  findXContents {
    id
    data
      title {
        en <--
      }
    }
  }
}

For REST I recommend to have a look to these headers: https://docs.squidex.io/02-documentation/concepts/localization#how-to-use-the-api

As for traffic - It’s all textual. Videos and photos are hosted on YouTube/AWS S3. Does that make sense?

Weird, 70GB is a lot, just for text.

I’ll send you an email now with more private details. Thanks!

Please send it as PM (click my avatar)

We will try the method you suggested first. Will update tomorrow. Thanks!

1 Like