Cache stateless content for everyone
| Project: | Drupal |
| Version: | 7.x-dev |
| Component: | base system |
| Category: | feature request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | active |
Jump to:
A lot of pages, blocks, etc are stateless (one state) for every user/role. When all controllers define whether they are stateless or statefull it becomes possible to cache their output for everyone (when they are stateless of course).
For pages the state-amount can be defined in menu_hook.
For blocks in $op = 'info'
For other output like tabs, scripts, styles, html_head in their add_ function's
Themes are rendered by calling theme_functions in a top-down approach (e.g. theme_page is called first, within this function regions (within these blocks), content, tabs, etc. When children-calls (with this I mean for example the blocks called by region) tell their caller (in this case regions) whether they are stateless or statefull it becomes possible to cache a whole region for everyone (when all blocks in that region are stateless).
My request is thus that controllers define whether they are stateless or statefull (how exactly this should be implemented needs some more thinking of course).
My second request is to try to create stateless controllers wherever possible (e.g. in case of pages for every state a different controller; for pages this means seperate paths). This should, I think, be adviced to every module-developer.
I'd like some discussion about this.

#1
I want to add that content which is only accessible for certain users/roles can be stateless too; It only has to be checked whether a user has access to it.
#2