Caching of web pages and SPA

1

I have read about SPA (single page application) and learned that biggest advantage of those is that save network traffic because SPA downloads all (at least most of them) application resources when loading the page.

But I am not clear on this - suppose in my index.jsp I have specified all my resources and downloaded when loading index.jsp. Now my application navigation starts from index.jsp, so for navigation I submit my form and which has action="user.jsp"

Now, since I have action="user.jsp" so on submitting the form my web browser will send a request to server to get user.jsp. Please correct me if I am wrong. Or will be taken from HTTP cache. But lets say through some Apache setting (I have read somewhere that it is possible but don't know how to do it) I have disabled the HTTP caching of web page then user.jsp will be downloaded from server.

Much appreciated if somebody can throw good insight on it. Basically I am confused with the fact that action="user.jsp" will lead a call to server and HTTP/browser can cache web pages.

Priu

Posted 2016-03-12T16:15:28.827

Reputation: 11

Answers

0

HTTP POSTS aren't cached by browsers. The purpose for HTTP POST (form submit) is to send forms fields to the server for processing. The browser can't know how the server will respond to this as it would have to have some insight into the specific page/forms server-side behavior. The request to user.jsp, in your case, would not be cached, but it is possible that scripts, css, etc referenced on user.jsp would come out of the browser cache, depending on how caching is configured on the server for those resources.

ttaylor1218

Posted 2016-03-12T16:15:28.827

Reputation: 166