Is session favorites module designed to work with anonymous users and cached pages? I have several problems with the module that may have started when I turned caching on. For example the page listing the personal favorites is cached. After I forced caching off in _session_favorites_page() the page is no longer in {cache_page}.
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | session_favorites.359302.patch | 3.97 KB | sutharsan |
Comments
Comment #1
sutharsan commentedI have been able to add the required code to get session_favorites working (better) with anonymous users. A patch is attached.
The addition of
$GLOBALS['conf']['cache'] = FALSE;looks a bit hacky to me, but it sure works to prevent caching of the favorites page.Comment #2
jhedstromThanks Sutharsan. The idea of the patch sounds great, but the attached patch appears to be for UI/javascript-related changes. Am I missing something?
Comment #3
sutharsan commentedThe patch does two things: the above mentioned prevention of caching and it adds an Ajax call upon page load calling favorit_path/js/get that updates the favorit link based on the node's favorit status.
Comment #4
brian_c commentedRather defeats the purpose of caching, if every node view now triggers a server-side AJAX call that Drupal needs to fully process.
To really make Session Favorites work efficiently for cached sites, I think the best solution would be to store favorites locally in a cookie, then JS can modify the page based on the cookie, without needing a server hit.