Hi,
I'm not sure if this is well-known or not. I guess http://drupal.org/node/278723 is related, at least what is described in the very first post.

When caching is enabled, pages for *anonymous users* are cached until their save timestamp is newer than the cache. For generated pages like the biblio main page, there is no either such timestamp or the page changes due to dynamic content without the timestamp being updated.

Thus, anonymous users cannot use search or filters. Althouth they are correctly saved in $_SESSION, the biblio main page will be taken from the cache and so never change. If wonder if this is the reason why anonymous users cannot use filters on http://liiscience.org/biblio either, or if it's disabled intentionally there.

There's an easy solution to prevent caching of the biblio page and its subpaths like biblio/filter etc. by putting this into biblio_init():

function biblio_init() {
  drupal_add_css(drupal_get_path('module', 'biblio') .'/biblio.css');

  // Prevent caching of biblio pages
  $base = variable_get('biblio_base', 'biblio');
  if (drupal_match_path($_GET['q'], "$base\n$base/*"))
    $GLOBALS['conf']['cache'] = FALSE;
}

Note that when testing this you must once clear the cache because this code will just prevent the generation of new caches but not delete existing ones for anonymous users.

There's a module that allows configuring pathes that should not be cached http://drupal.org/project/cacheexclude, but I think that biblio should ensure by itself that also anonymous users can filter and search. What do you think?

Comments

rjerome’s picture

Fantastic, I had forgotten about that little issue :-(

I'm surprised you say anonymous users cannot use filters on liiscience, they seem to work for me when I'm not logged in, and I don't have any caching turned on on that site either.

Ron.

Frank Steiner’s picture

Strange, when I do any filtering it's just ignored... Maybe it's a local cache issue in my browser, I will have to check.

Do you want me to make it a patch or will you care about it yourself? Btw, congrats for getting the the 1.0 finished :-) (Although I still didn't upgrade, shame on me :-/)

rjerome’s picture

Thanks Frank,

No need for a patch, that's a pretty minor change.

Ron.

rjerome’s picture

Status: Active » Fixed

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.