I don't believe this is a framework issue. In my research it seems to be a browser cache issue but the things I've tried have not worked.
Unfortunately even though I don't want the user to click the back button but obviously there is no way (really) to block the user from clicking the back button.
This is the result of the form upload.
This works fine I get the expected result.
When the user clicks the back button they get the orignal form instead of the image that they just uploaded.
after the user clicks refresh after clicking the back button from the submitted form they get the uploaded image that should show up.
I do have two templates layout.php and layout_wide.php
I have tried this in both templates.
<meta http-equiv="cache-control" content="max-age=0" />
<meta http-equiv="cache-control" content="no-cache" />
<meta http-equiv="expires" content="0" />
<meta http-equiv="pragma" content="no-cache" />
I have tried this custom helper...
<?php
function include_stylesheets_versioned()
{
$response = sfContext::getInstance()->getResponse();
sfConfig::set('symfony.asset.stylesheets_included', true);
$html = '';
foreach ($response->getStylesheets() as $file => $options) {
if ((strpos($file, '?') === false) && (stripos($file, 'http') !== 0) ) {
$file .= '?v='.sfConfig::get('app_resource_version');
}
$html .= stylesheet_tag($file, $options);
}
echo $html;
}
function include_javascripts_versioned()
{
$response = sfContext::getInstance()->getResponse();
sfConfig::set('symfony.asset.javascripts_included', true);
$html = '';
foreach ($response->getJavascripts() as $file => $options) {
if ((strpos($file, '?') === false) && (stripos($file, 'http') !== 0) ) {
$file .= '?v='.sfConfig::get('app_resource_version');
}
$html .= javascript_include_tag($file, $options);
}
echo $html;
}
I am ready to try putting it in a modal or an iframe to take the back button issue out for this form. But I have another form with a similar issue where putting into a modal isn't an option.
I did see the Post Redirect Get Design Pattern yesterday and think it may be a solution but I am wondering why the meta tags are not working at all.
I realize this may be a duplicate question but I couldn't find a solution that worked.
Has anyone else run into this and can someone please point me to a solution.
The app is sitting on a AWS instance and the Server is NGINX if that has any bearing on it.
Thank you in advance.