Skip to content

[Content]: "cache key" vs "query key" #1198

Open
@klequis

Description

@klequis

📚 Subject area/topic

"cache key" vs "query key"

📋 Page(s) affected (or suggested, for new content)

📋 Description of content that is out-of-date or incorrect

"cache key" vs "query key"

Here is a thought. There my be different prespectives but I think changing "cache key" to "query key" is an improvement in clarity. It seems a significant change because the term is used in multiple docs pages. It seems possible that "cache key" is a leftover from the renaming of cache to query.

const myQuery = query(async () => {
  return fetch(...)
}, "myQuery")
  • The key is a parameter of query. It is not a key to the query's internal cache.
  • A given query does have a cache, but it is not keyed by the key parameter (in this case "myQuery"), it is keyed by the parameters sent to the function that query returns.

It may also be helpful, when talking about the cache for a given query to call it the "internal cache" as in "a query's internal cache"

🖥️ Reproduction in StackBlitz (if reporting incorrect content or code samples)

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions