Umair Umair - 1 year ago 84
Javascript Question

Make window.location.href load page from Server instead from browser cache

I am making a redirect using

to Listing view after an Item is added to DB after successful CREATE operation.

But what it does, it simply fetches old page (not showing the newly added item) that was previously in borwser's cache.

I want it to fetch every think from server, just like we use
parameter in
to load a fresh copy of page from server.

Answer Source

You can use this:

window.location.href = ""+ (new Date().getTime());


window.location.href = ""+ Math.random();