Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add seamless integration with ifModified jQuery's option #17

Open
rosenfeld opened this issue Jul 21, 2013 · 0 comments
Open

Add seamless integration with ifModified jQuery's option #17

rosenfeld opened this issue Jul 21, 2013 · 0 comments

Comments

@rosenfeld
Copy link

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant