I have a Django project with a view that has a lot of python code to calculate data for specific table in its template (2-4 seconds).
To improve user experience I decided to load template immediately with empty table and get necessary data via jQuery $.getJSON request.
$(document).ready(function() {
$(function() {
$.getJSON(devices_list_JSON, function(data){
// fill table data
...
}
}
}
I've done so and it works fine except of one issue.
When I go to some page and back to my view using browser Back
button, browser make JSON request again.
And I want to use cached version as it was in a view that calculated all data in its python code.
How can I do so?
(I use Google Chrome 68.0.3440.106 browser)