Or can't you build a Proxy controller for such files and let the controller
add header tags for browsers not to cache (must-revalidate, etc.)? So then
from your view instead of placing the OBJECT tag to directly find the swf
you use the controller as a source, something like
/animations/animation.swf
And then the animations controller is something like:
class AnimationsController extends AppController
{
var $name = 'Animations';
var $uses = null;
var $animationPath = WWW_ROOT . DS . 'animations';
function index($file)
{
$filePath = $this->downloadPath . DS . $file;
// Check against path injection
if (preg_match('/^[A-Za-z0-9_\-\.]*$/', $file) &&
is_readable($filePath))
{
if (!headers_sent())
{
$size = @filesize($filePath);
if ($size > 0)
{
header('Content-length: ' . $size);
}
// Disable caching
header('Cache-Control: no-cache, no-store,
max-age=0, must-revalidate');
header('Expires: Mon, 26 Jul 1997 05:00:00
GMT');
header('Pragma: no-cache');
// Set content type
header('Content-Type:
application/x-shockwave-flash');
}
readfile($filePath);
exit;
}
return $this->redirect('/');
}
}
-MI
---------------------------------------------------------------------------
Remember, smart coders answer ten questions for every question they ask.
So be smart, be cool, and share your knowledge.
BAKE ON!
-----Mensaje original-----
De: [email protected] [mailto:[EMAIL PROTECTED] En nombre
de Claudio Poli
Enviado el: Lunes, 25 de Diciembre de 2006 01:26 p.m.
Para: [email protected]
Asunto: Re: force swf refresh
no problem,
I know the issue because I've worked with swf charts and IE keeps
caching the file.
there's something you can do, instead of putting an hash to swf, try
putting something like this in source url:
/controller/action/param?uniqueid='.uniqid(rand(),true)
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake
PHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---