Add cache invalidation on write operations for cached endpoints #32
Labels
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: cal/major-domo-database#32
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
GET endpoints use
@cache_resultwith 30-min TTLs, but PATCH/PUT/POST/DELETE endpoints don't callinvalidate_cache().PlayerServicedefinescache_patternsbut they're never used to clear cache after writes. Stale data persists up to 30 minutes.Priority: medium | Labels: bug, performance
Fixed in PR #47.
Added
finally:blocks toupdate_player,patch_player,create_players, anddelete_playerinPlayerServicethat calltemp_service.invalidate_related_cache(cls.cache_patterns). This activates the existingcache_patterns = ["players*", "players-search*", "player*", "team-roster*"]that was defined but never used. Matches the pattern already correctly implemented inTeamService.