Imagine the following use case:
I use an AJAX request for getting some info about Item
and use this URL: http://domain/items/show/1
In my database all items have a field called modified_at
where we store the moment when this item was previously modified.
How can Last-Modified
server HTTP header in response can minimize load/reduce requests/increase responsiveness if we need to process this request every time on the server side? It looks like we don't reduce the number of HTTP requests with that response and we don't reduce the load on server.
Who needs this anyway?
Am I right, that it's used mostly for the purpose of saving bandwidth?
The purpose is to save bandwidth, not on your server but on the client. Uncachable AJAX requests will likely make the UI incredibly slow for your visitors, not having to transfer data over and over again drastically improves performance in the client's browser.
If you want to reduce the number of reqs you should set an explicit Expires
header on the response. The client won't request the resource until the time set by Expires
has run out.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With