jquery / jquery/api.jquery.com
Mention of ‘timestamp’ in documentation for ‘cache’ parameter of ‘ajax’ is misleading
Nobody has claimed this yet.
- Dominant language
- HTML
- Stars
- 325
- Forks
- 260
- PR merge metrics
- No merged PRs in 30d
Description
The documentation for the ‘cache’ parameter of ‘ajax’ says:
It works by appending "_={timestamp}" to the GET parameters.
This seems a bit misleading. I interpreted it as a timestamp of when the request is sent. But the value after _= is actually taken from a counter:
https://github.com/jquery/jquery/blob/f79d5f1a337528940ab7029d4f8bbba72326f269/dist/jquery.js#L9435
The counter is only initialized using Date.now():
https://github.com/jquery/jquery/blob/f79d5f1a337528940ab7029d4f8bbba72326f269/dist/jquery.js#L8501
I got confused by that when analyzing nginx access logs and wondering why the ‘timestamps’ didn’t match up.
The documentation should probably just say that it works by appending "_={uid}".
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the documentation entry for the ajax cache parameter and compare its wording with the referenced dist/jquery.js lines 9435 and 8501. Update the description so it refers to the appended value as a uid rather than a timestamp; the misleading wording should no longer appear.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- jquery
- Domain
- documentation
- Issue type
- Documentation
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 62/100