Skip to content

Conversation

@indykoning
Copy link
Member

This pr requires: https://github.com/rapidez/laravel-multi-cache
ref: RAP-1679

This PR implements tags for some values saved in cache.
This allows us to only clear caches relevant to product indexation during the Rapidez indexers

@indykoning indykoning requested a review from royduin as a code owner December 4, 2025 12:44
}), 'id', 'code');

return Cache::rememberForever('swatchvalues', function () use ($swatchAttributes) {
return Cache::store('rapidez:multi')->tags('swatches')->rememberForever('swatchvalues', function () use ($swatchAttributes) {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On top of speeding up repeated fetches, store('rapidez:multi') here allows us to always run the tags function, falling back to not using tags if the underlying store does not support tags.

Regular Laravel would throw an exception

@royduin royduin merged commit c19493b into master Dec 5, 2025
12 of 27 checks passed
@royduin royduin deleted the feature/cache-tags branch December 5, 2025 07:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants