It is my understanding that Drupal serves cached pages only to anonymous users, and makes multiple database hits for registered users.

On a site I am developing, though, I would like to be able to serve certain pages and/or sections cached even to registered users, since the info there will not change often and I'd like to avoid the database hits if the content has not been recently updated. Is there a way I can do this?

I am curious about this for both 4.7 and 5.

Thanks in advance.

Comments

MacRonin’s picture

I'm not sure if it considered complete yet, but there is a new function that might help. While I don't think it will cache entire pages fro registered users, it does cache some of the blocks used to make up the page. And from what I understand it has a good impact since the majority of page creation work often comes from just a few of the blocks on a page

http://drupal.org/project/blockcache

This module creates a cached version of each block. Block caching happens separately from page caching and so it will work for logged-in users whether or not page caching is enabled for the site. Cached blocks make just one call to the database and can therefore reduce the overhead required to render blocks that require complex queries and/or calculations such as some Views or Taxonomy-related blocks.

When this BlockCache is enabled, administrators will see a duplicate "cached" version of each of the site's blocks. By enabling the cached version (and disabling the original version), you can display a block that is physically identical to the original, but is loaded from the cache rather than calculated for each page. This can greatly speed up the rendering of a page. There are options for how and when the cache is refreshed and whether it is cached for the whole site or on a page-by-page basis.

-------------------
http://www.PrivacyDigest.com/ News from the Privacy Front
http://www.SunflowerChildren.org/ Helping children around the world

robhamm’s picture

Thanks, man! I'll check it out.

Rob Hamm
http://www.bluecrashkit.com (my current webcomic and means of support)
http://www.syberfang.com (my upcoming webcomic)

felixsmile’s picture

Hello,

this is something I've been thinking about a lot: is there really no way to cache pages for registered users? Usually, I suppose that 99 % of the users will be in no specific role and will see the same page.

Has no one any idea about this?

Thank you in advance,

Felix

aymerick’s picture