before i go deeper into documentation and code i would like for someone to answer couple of simple questions:
how does caching happen? is it doing it by itself? is it time based or invalidates when necessary?
(assuming i am using AR) when i fetch a row by id is it cached by itself or do i have to cache stuff myself? if i fetch a set, is it all cached? when i later modify that row, or set, how is it invalidated? if i perform a manual sql statement, it is going to invalidated affected keys in cache?
Caching is done how it is done all the time. You want an item (or page fragment, or a whole page or whatever). First you check whether a cached one exists. Then cache validates both if it’s expired and if all the dependencies validate the value.
If there isn’t cache hit (time expired, file is changed, row has been updated, or there hadn’t been any cached item at all etc.), then the script generate the item and save.
ActiveRecords are not cached. They are only stored in variables. (However, you can cache them manually of course.)