Q
Q
qqqqqqqqqqqa2021-07-24 22:23:13
Node.js
qqqqqqqqqqqa, 2021-07-24 22:23:13

How, when changing the url (via the history api), do not send data about the url change to the server?

I have a site where the node js server processes client urls (when entering the site or moving to its other pages) and filters out incorrect / non-existent urls , and outputs to the client (regardless of the url ) a standard empty php file , which fills itself with the necessary static and other files, loading them depending on the url . This scheme turned out to be working, but it did not work quite correctly, because even if the page content changed on the client depending on the url of the address bar, the server still read these urls

-s and updated the page in its own way, as if it were the first time you entered the site. Those. the server read the address line update constantly, and this caused constant reboots.
Therefore: when changing the url on the client side (via history api ), how not to send a signal to the server that it should change something there? If it is simpler, then how to hide from the server the change in the state of the address bar of the browser?

And by the way, when changing the url , the client should, in theory, send some http request to the server, can it just limit the sending of these requests, or not?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question