Skip to content

Set the infos cache of the keyword after a url is added/updated/deleted#4008

Merged
ozh merged 2 commits intoYOURLS:masterfrom
matt-h:fix/3772-update-cache
Oct 30, 2025
Merged

Set the infos cache of the keyword after a url is added/updated/deleted#4008
ozh merged 2 commits intoYOURLS:masterfrom
matt-h:fix/3772-update-cache

Conversation

@matt-h
Copy link
Copy Markdown
Contributor

@matt-h matt-h commented Oct 25, 2025

Set the infos cache of the keyword after a url is added/updated/deleted to/from the database.

This will allow it to overwrite the cache with the updated keyword if a cache was already set on the request. Basically it will keep the cache in sync with changes as they happen. Purging the cache in the case it doesn't know what to update.

This will prevent plugins accessing cached data from accessing stale data.

Adds a new function update_infos_if_exists to the YDB class to update values on an existing cache if it exists. Basically a helper to reduce redundancy on updating cache.

Add tests to test the logic.

Fixes #3772

…ed to/from the database.

This will allow it to overwrite the cache with the updated keyword if a cache was already set on the request.

This will prevent plugins accessing cached data from accessing stale data.

Adds a new function update_infos_if_exists to the YDB class to update values on an existing cache if it exists

Add tests to test the logic.

Fixes YOURLS#3772
Copy link
Copy Markdown
Member

@ozh ozh left a comment

Choose a reason for hiding this comment

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

Fantastic once again ❤️

Copy link
Copy Markdown
Member

@LeoColomb LeoColomb left a comment

Choose a reason for hiding this comment

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

Idea and code LGTM.
I haven't proof-tested the logic.

@ozh ozh merged commit a84a356 into YOURLS:master Oct 30, 2025
6 checks passed
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.

YDB cache array not updated after new link creation

3 participants