How to automatically request a token from the server when the page is first loaded
Answered
Knopper gall posted this in #help-forum
Knopper gallOP
What I want to accomplish is to automatically request a new token (if one is available) the first time the user requests a page, but not require this action when navigating within the site?
Answered by B33fb0n3
when there are no more requests to the server again, then the page is inside your browser cache. You can request a new token once for example directly on your page. It will be called everytime when a new request to the server is made for that page. So you can navigate inside the page using the browser cache (there is no request) and when the browser cache is invalid, there is a request for a new token
6 Replies
... when navigating within the site?Can you clarify that?
When a user navigates to a different page, the code of that pages will be executed. Same for the next route and so on
@B33fb0n3 > ... when navigating within the site?
Can you clarify that?
When a user navigates to a different page, the code of that pages will be executed. Same for the next route and so on
Knopper gallOP
What I mean is that when a user first connects to my page
my-website will be requested once, but no matter how you navigate to it afterwardsmy-website/page or anywhere will not request the server again@Knopper gall What I mean is that when a user first connects to my page
`my-website` will be requested once, but no matter how you navigate to it afterwards
`my-website/page` or anywhere will not request the server again
when there are no more requests to the server again, then the page is inside your browser cache. You can request a new token once for example directly on your page. It will be called everytime when a new request to the server is made for that page. So you can navigate inside the page using the browser cache (there is no request) and when the browser cache is invalid, there is a request for a new token
Answer