diff --git a/boost.module b/boost.module index 1b0ba86..03cf8d3 100644 --- a/boost.module +++ b/boost.module @@ -165,6 +165,19 @@ function boost_init() { || variable_get('site_offline', 0) || isset($_SESSION['messages']) // do not cache pages with messages ) { + // try to clear cache for this page so that drupal_set_message() shows up on page reload + if ( (strpos($_SERVER['SCRIPT_FILENAME'], 'index.php') == TRUE ) + && ( ($_SERVER['REQUEST_METHOD'] == 'POST') || isset($_SESSION['messages'])) + ) { + $_boost = boost_transform_url(); + if (file_exists($_boost['filename'].'.html')) { + unlink($_boost['filename'].'.html'); + } + // clean variable afterwards + $_boost = array(); + } + + // and avoid caching this page $_boost['cache_this'] = FALSE; } else {