I have an API to handle cache control. Server will set response header "last-modified" and next request from browser will have If-modified-Since header.
However, when I use ajax to request API, it will not set If-modified-Since header automatically. And I set If-modified-Since in ajax request header, server response 304 status code. But response body is empty.
Is ajax need to manually to fulfill browser behavior about cache control?
Is there better solution?
I find a similar question here.