It caches the complete template and then applies the conventions so that the right json / html can be served to the right user?
This part of the question seems a little unclear to me, so I will provide various options based on what “conventions” may be.
, , @variables ( -). :
.welcome_block
- if @user.admin?
%h4 Hello, admin!
- else
%h4 Hello, user!
, cache ['users_haml'], ( - ). , , h4, , . , digest users_haml, cache, - .
, cache @user . , users.haml, , / . , digest User, cache_digests N N .
, , - , , :
- cache [@user.month_of_birth]
- if @user.month_of_birth == 'October'
= render 'partial_one'
- else
= render 'partial_two'
, . , partial_one? cache_digests , , ( )?
, . , , , users.haml partial_one, partial_two, users.haml, .