I have no idea where to put this, so please feel free to shunt it to the correct place.
My site has a frame-based interface, and mostly runs on javascript. I use AJAX to load a user's details from the database on login, and the program saves the details each 'turn'. However, even though the details are correctly saved, if I close the browser window and then return soon afterwards, then when I log in it gives the same details I got lat time I logged in rather than the most recent set.
Does anyone know how I can prevent this?
I may look like an idiot - and I may talklike an idiot - but don't ever let that fool you. I really am an idiot.
It sounds more like your browser is caching the results, rather than the SQL. What database are you using? Can you try it in another browser after making a change and see if it changes?
It does change, so I guess it is the browser. How do I prevent that then?
I may look like an idiot - and I may talklike an idiot - but don't ever let that fool you. I really am an idiot.
I've tried a couple things which supposedly stop the page caching, but they don't seem to work... argh...
I may look like an idiot - and I may talklike an idiot - but don't ever let that fool you. I really am an idiot.
Perfect, works now.
Many thanks!
I may look like an idiot - and I may talklike an idiot - but don't ever let that fool you. I really am an idiot.
In case someone still needs it, the phpfunction (documentation) is where you specify the "Expires: date_in_past" to prevent browser caching. Although some sites actually benefit from caching; I do not disable it on my coding blog.Code:header
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks