I am trying to cache a very simple javascript response. I am using rails and my views/projects/index.js.erb contains only the following:
alert('hi');
and when I request
$.ajax({
type: 'GET',
cache: true,
url : '/projects',
dataType: 'script'
});
I get the popup 'hi' and I see in my server log that a request to Projects#index action as js has been made to it.
Then without refreshing the browser and I do it again
$.ajax({
type: 'GET',
cache: true,
url : '/projects',
dataType: 'script'
});
I see that the server still gets a request can anyone spot anything that I might have missed?
Thank you!
$.ajax()
not$.getScript()
. That's probably the issue. – Extramarital