Splash doesn't turn off properly on cached page views.
incidentist - February 10, 2009 - 20:17
| Project: | Splash |
| Version: | 6.x-2.3 |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | active |
Jump to:
Description
To replicate: turn on normal caching, set Splash to only appear once, log out, and view the front page twice.
What should happen: the splash should not appear on the second load.
What happens: Splash appears the second time around.
This is with thickbox, but it probably does the same thing with other splash types.
In Drupal 6, hook_init() is not called on cached pages. hook_boot() is. There needs to be a function that can clear the cache if we're on the page that the splash is set to appear on. If you've got the same problem, you can use this function until something better comes along:
<?php
function splash_boot() {
// We can't cache the front page
global $base_root;
if (!function_exists('arg')) {
drupal_bootstrap(DRUPAL_BOOTSTRAP_PATH);
}
if ($_GET['q'] == drupal_get_normal_path(variable_get('site_frontpage', 'node'))) {
cache_clear_all($base_root . request_uri(), 'cache_page');
}
}
?>
#1
I have the same problem.
I already modify the module to make it to work on all pages using thickbox. The user can enter to the site using any url and the splash work perfect, but when the cache is "normal", the problem is there.
I'm experimenting with hook_boot() and hook_exit() without luck
Any idea?
#2
How does this affect performance? Anyone used this in a production environment? I'd prefer to find a way around this that doesn't completely disable the cache for that page.
#3
Yes, would be nice found to keep the Splash module working even when the cache is active.
For now, the Splash doesn't work with cache.
Maybe the incidentist's idea work for the front_page or you can use http://drupal.org/project/cacheexclude. But I need the Splash module working in all pages to check if the user is over 18.
#4
I looked into this some more and was just going to recommend that module. I really can't think of any other way to do this. There is no way to exclude a single module from caching, unfortunately. Drupal seems to want all or nothing.