americanexpress / americanexpress/fetchye

Order query params for more cache hits

Open
#42 2 comments 0 reactions 0 assignees View on GitHub
stale-issue
Dominant language
JavaScript
Stars
46
Forks
27
PR merge metrics
No merged PRs in 30d

Description

# 💡 Feature request

## Is your feature request related to a problem? Please describe

Currently query params are required to be in the same order for a cache hit.

The following calls will not be considered the same and will result in unexpected cache misses:
`useFetchye('https://test.com/some-path?a=1&b=2')`
`useFetchye("https://test.com/some-path?b=2&a=1')`

## Example

Oder of query params should not matter.

`useFetchye('https://test.com/some-path?a=1&b=2')` and `useFetchye('https://test.com/some-path?b=2&a=1')` will use the same cache entry

Contributor guide

Open the contributing guide

Research direction

No source file or test is named in the issue. Start by tracing how Fetchye parses query parameters and generates cache keys for useFetchye calls; done means URLs differing only in query-parameter order resolve to the same cache entry, with equivalent behavior covered by tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, react
Domain
frontend, performance
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.