Turn off caching if one or more particular GET params exit

Hi guys!

  I use COutputCache in Filters to cache the whole page, a page showing a list of items. But there is a search feature in the same action. In the action,  the search form is passed through GET, and here is the problem, for every search combination, there is a corresponding cache, and the number of combination is tremendous。I wonder if there is a way, the COutputCache will turn off caching the page with some particular GET param, but still cache the file if the GET param name is another one. 

For example:

cache the page: localhost/controller/action?GET_1=2

while don’t cache the page: localhost/controller/action?GET_2=2

Anyone got an idea?

I’v found a way to do this, you can see this post: http://www.yiiframework.com/forum/index.php/topic/23929-want-to-cache-whole-page-only-for-guests/

modified the following:

'COutputCache + actionName'


'COutputCache + ' . (isset($_GET['the_exclusive_GET_param'] ? '' : 'actionName'))

Hope the next yii version will add more exclusive configure params for COutputCache