What's different of view cache and event cache?

What's different of view cache and event cache?

What happen when I cache view and event same time?

event caching, basically caches the output of an event. This can basically mean a layout/view combination. Also, when a request comes in for that event, no execution takes place except a few interceptors and on request start.

View caching, caches just the output of the rendered view. Whenever a view is asked to be rendered, whether manually or by an event, the contents is just grabbed from cache. The main difference, is the executions. All the executions take place here.

so if the view is pulled from cache, but the events are executed,
what's the point of executing the events? like... when would you want
to use view caching as opposed to event caching?

thanks Luis.

marc

I would use view caching, when I am using it for partial renderings. Where views are shared between events, maybe like headers, footers, or partial views. Bits of HTML that can be individually cached to create a major composite that the event sets up or prepares. Does this make sense?

Because a partial view can be used in different events and views also, so instead of re-rendering, you can just cache partials.

Luis

yup, makes sense. Thanks Luis!

Do you do much of this kind of thing?

marc

I mostly use event caching.

Partials very sendomly

I'm clear understand.
Thanks Luis for your explanation.