Skip to content

getItemsByTag(tagname) does not returns all items with given tag name though item is saved with same tag name.. #719

Closed
@msinghgithub

Description

@msinghgithub

Configuration

  • PhpFastCache version: "2.0.4"
  • PhpFastCache API version: "7.1.0"
  • PHP version: "7.3.9"
  • Operating system: "Windows 8.1 "

Describe the bug

getItemsByTag(tagname) seems not working as expected. I have to delete key matching all keys with prefix eg. 'cachekey_'. For this purpose I used getItemsByTag(tagname) to fetch all items with shared tag name and delete matched keys. But it is not returing all cached keys with shared tag ''. However, haskey(key), $item->get() returns data.

To Reproduce
Steps to reproduce the behavior:
Save multiple items with key prefix 'cachekey_' eg. 'cachekey_01', 'cachekey_022', 'cachekey_033', 'cachekey_014', 'cachekey_305', 'cachekey_ffg0' etc.
Save these items with a shared tag in my case '' tagname is used. I tried with static tagname ('pfc') but does not help.
Now list all items stored with tagname '' using getItemsByTag('') method. It should return all keys but unfortunately it doesnot returns all keys. eg. it returns all except 'cachekey_014'. However, haskey('cachekey_014'), $item->get() returns data.

Expected behavior
getItemsByTag('') should returns all keys sharing the tagname ''. So that i can check for partially matched key and delete the matched keys.

Current behavior
All items that share the shared tags are removed only if it is listed by getItemsByTag(''). But few items are not listed. Due to this reason i could not delete key to recreate key with fresh data and showing stale data.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions