Applying Different Cache Logic For Different Actions

In addition to my previous question about how to use both cache methods COutputCache and CHttpCacheFilter in Yii, I have another question about if is it possible to apply different cache rules depending on the action.

For example, for the index action I’d like to set a duration of 3600 while for other actions I’d like to set a higher duration or even a different varyBySession value. Is possible to define different properties and add them to the filters chain?

Haven’t tried it myself, but I don’t see any reason why you couldn’t do this


public function filters()

{

	return array(

			array('COutputCache + view', 

				'duration' => 3600

			),

			array('COutputCache + someOtherAction', 

				'duration' => 86400

			);

);