A
A
alh_22016-08-12 19:27:09
PHP
alh_2, 2016-08-12 19:27:09

Ajax returns the same requests with php, how to fix?

I have created a script on js that sends a fail.php request to the server using ajax (the page does not reload) and gives a response, in php itself there is a code that should give ajax a new response every time, but this does not happen, it turns out the same same. To avoid this, you have to reload the entire page. How to solve it?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alexey Yarkov, 2016-08-12
@alh_2

Read about caching. Well, show me the code.

N
nelolka, 2016-08-13
@nelolka

Use POST or send headers to the browser that prohibit caching. If you request with a timestamp or a random number regularly, then the user's cache will become clogged.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question