I have an Image container which will dynamically be filled with image tag after AJAX request. The AJAX code is as simple as below and it run after the page fully loaded.
$(document).ready(function () {
$.ajax({
url: '/product/GetImageUrl',
type: 'GET',
data: { id: id },
success: function (result) {
var imageBox = $('#image-container');
imageBox.append('<img src="' + result.ImageUrl + '">')
}
});
});
The AJAX is only request the image URL. I see the image is successfully loaded.
However, when I refresh the page, the browser keeps downloading the image, although the URL is still the same.
What should I do to tell browser to cache the image URL?