V
V
Vladimir Mukovoz2017-07-28 14:19:59
JavaScript
Vladimir Mukovoz, 2017-07-28 14:19:59

How to auto-refresh the page if the bx-rand in the header got a more recent last-modified?

I made the pages cache in the browser until 8 pm, but I would like the page to load a new page when the content changes. The site is on Bitrix and there is a composite that sends a background subrequest with the argument ?bxrand={timestamp} in the header of which you can see the last-modified header and compare its value with the date header of the current page.
Now the question is, how can this be compared and how can I force the page to update if date is older than last-modified?
If the page is updated to f5, it will load the new data itself, I need it to be updated without f5.
I’ll also add an explanation, I don’t need a cycle, I need the page to load, the script placed on it makes a subrequest, and if this page is relevant, then everything remains as it is, if not, then the page is updated.
I apologize in advance, I understand that this can be done not with a large js script, but js is just starting to study, my profile is the server part. Therefore, it’s not difficult for anyone to kick as possible in a more accurate direction, mutual assistance is possible, you tell me with js, I’ll tell you with the server)

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