tenancy icon indicating copy to clipboard operation
tenancy copied to clipboard

Allow suffix for prefixed Redis connections

Open miagg opened this issue 2 years ago • 2 comments

This will allow suffixing Redis tenant connections with a configured suffix or default to _ for better readability.

miagg avatar Jan 30 '24 15:01 miagg

Could consider merging this, though some things would need to be resolved first:

  • the '_' default is a breaking change
  • all new functionality needs to be tested
  • not sure about the suffix term. Can't really think of anything better though this makes it sound like a suffix that could go after the entire key.

Maybe I could change this to be

'prefix' => 'tenant%tenant%_',

in v4, where %tenant% gets replaced by the current tenant key.

stancl avatar Jan 30 '24 16:01 stancl

Could consider merging this, though some things would need to be resolved first:

  • the '_' default is a breaking change
  • all new functionality needs to be tested
  • not sure about the suffix term. Can't really think of anything better though this makes it sound like a suffix that could go after the entire key.

Maybe I could change this to be

'prefix' => 'tenant%tenant%_',

in v4, where %tenant% gets replaced by the current tenant key.

I agree on using a template string. Not sure how close v4 is though. Would it be merged in v3 if I remove the _ default?

miagg avatar Jan 30 '24 16:01 miagg

@miagg @stancl Might this also be relevant to Laravel 11 since the : is no longer appended to prefixes? https://laravel.com/docs/11.x/upgrade#cache-key-prefixes I'm currently trying to get my upgrade to L11 finished and wrestling with some caching errors which might be related

colinmackinlay avatar Mar 17 '24 15:03 colinmackinlay

I will not be merging this PR into v3, but yes, L11 had some cache prefix changes. I don't think there's anything needed to change on our end, just flush all cache. Laravel basically just stopped inconsistently adding :. In v4 we just updated some low level test asssertions.

stancl avatar Mar 17 '24 17:03 stancl

Implemented in v4 as described above.

stancl avatar Apr 07 '24 17:04 stancl