gin-contrib / gin-contrib/cache

does this support dynamic key for a route?

Open
#106 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Go
Stars
456
Forks
100
Avg merge
2h 16m
Merged PRs (30d)
2

Description

lets say we have an authenticated required api endpoint GET /userdata

that returns details about the authenticated user that calls it

user1 calls GET /userdata and wants response for user1
user2 calls GET /userdata and wants response for user2

does this middleware support the above?

how do we achieve this? because currently the cache just creates one single key for each route endpoint and that does not work and i would think others have the use-case i described above

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading the cache middleware behavior for the authenticated GET /userdata endpoint, focusing on how it creates one key per route. Determine how cache entries could be separated for user1 and user2, then define and verify the expected behavior for two authenticated callers.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
api, backend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.