Hi. Thank you for useful module.

I have faced fatal error when page can't be cached. For example drupal_set_message can block cache on page.

Comments

AlexKirienko’s picture

Status: Active » Needs review
StatusFileSize
new1.42 KB

Please check attached patch with fix.

eddie_c’s picture

Thanks for the patch AlexKirienko. I've encountered what I believe is the same problem, although for me it just results in a blank 404 page being cached, not a fatal error.

Just to be clear about the problem which this patch addresses, here's what I believe to be happening:

- drupal_page_set_cache() returns NULL if the page can't be cached. As you mention, this is because a message may be set on the page.
- In reuse_cached_404_page_set_cache(), this results in $cache being NULL.
- However, we still proceed to use $cache to set the 'reuse_cached_404' cache of the 404 page
- This results in a blank 404 page in the cache, which is then retrieved for all subsequent 404 pages.

eddie_c’s picture

Status: Needs review » Reviewed & tested by the community

I've tested the patch in #1 and it fixes the problem I've described in #2: If the 404 page is not cacheable, this patch prevents a blank 404 page from getting cached by the module.

liam morland’s picture

Status: Reviewed & tested by the community » Fixed

Thanks!

Status: Fixed » Closed (fixed)

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