Meena
Meena

Reputation: 967

Remove cache for one particular page using PHP

I am using Flowplayer in my webpage. Once the video ends, I change to another video and restart the player. My issue occurs if I remove the first video and upload the second video while still playing the first video. If I clear the browser cache and again restart the player, then it plays the last uploaded file. Please guide me: is there is any other way to clear the cache of a particular page, or restart the Flowplayer cache?

Upvotes: 0

Views: 3052

Answers (2)

Emil Vikström
Emil Vikström

Reputation: 91912

Make sure each video have it's own URL, and use this call to make sure the page in itself isn't cached:

header('Expires: Thu, 19 Nov 1981 08:52:00 GMT');
header('Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0');
header('Pragma: no-cache');

Upvotes: 1

Poelinca Dorin
Poelinca Dorin

Reputation: 9703

Add these 2 lines in you're code, somewhere at the top of you're app

header('Cache-Control: no-cache, must-revalidate');
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
// this date can be set somewhere in the past

Upvotes: 0

Related Questions