Skip to content

Mention of ‘timestamp’ in documentation for ‘cache’ parameter of ‘ajax’ is misleading #1241

Open
@Rinzwind

Description

@Rinzwind

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}".

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions