storyblok / storyblok-php-client

Storyblok - PHP Client
https://www.storyblok.com
MIT License
34 stars 37 forks source link

Language is not taken into consideration when caching / checking the cache #63

Open dannydorfel opened 2 years ago

dannydorfel commented 2 years ago

In the Client.php, line 605, the cache key is defined by stories/ . $slug and the options are missing. This causes the client to always return the first cached story when requesting other language versions of a story.

roberto-butti commented 1 year ago

I see. Thank you @dannydorfel . I see in the code we are also using some "options" that could contribute to defining the key for the cache. In this case, i would open a PR with and hash (as a suffix of the cache key) calculated on the relevant options.

From the implementation perspective, I think this issue is strongly related to this one: https://github.com/storyblok/php-client/pull/55#issuecomment-1176736159

What do you think?