Skip to content

Add seamless integration with ifModified jQuery's option #17

Open
@rosenfeld

Description

@rosenfeld

I'd like to request a feature if you have interest on implementing it.

What I'd really like is a plugin that would allow jQuery to automatically cache my responses when Last-Modified or ETag headers are set in the response.

When you set the ifModified option to true in the $.ajax options, jQuery will fill in the if-modified-since header for instance. But the main problem is that it won't cache the result of a request with a Last-Modified header present. That means the next time you make the ajax call, data will be undefined if the server responds with 304 (Not Modified).

If your plugin could automatically detect when Last-Modified or ETag is sent by the server and cache the result so that it is used in 304 responses transparently, then the caching would work seamlessly with no code changes in the sense that the ajax handlers will get the cached data in the arguments instead of undefined.

In the seamless mode, no cache is performed by the plugin unless Last-Modified or ETag is present in the header.

What do you think? Does it make sense?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions