Forum Moderators: coopster

Message Too Old, No Replies

Selective no-cache

         

andrewheiss

5:18 am on Feb 15, 2008 (gmt 0)

10+ Year Member



I'm working on a PHP/MySQL web application that inserts and displays data from a database (like all other web applications in the world...I'm so original :) )

When a user inserts new data, the inserted data doesn't get immediately shown on the main page, which lists the data in a table using "while" in PHP. The only way to get the data show is to refresh the page, which updates the cache.

To get around this, I've added some no cache headers to the top of the page to force the page to refresh. However, for me this seems excessive, to force a redownload of the graphic elements of the page. Is there a way to selectively force the no-cache? Could I restrict it to just one div of the page? Is there a better way to get around this caching thing?

Thanks!

phparion

6:28 am on Feb 15, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



if the page is refreshed after inserting data it must show the new data, provided with no-cache header information in your page.

Are you using AJAX to submit data without refreshing or submitting the page to a second page?

andrewheiss

3:52 pm on Feb 15, 2008 (gmt 0)

10+ Year Member



No AJAX - just submitting it to the database and then redirecting the page with header("location: index.php") back to the main display page