Yii Memcache中的缓存全页、部分或密钥缓存

Yii Memcache中的缓存全页、部分或密钥缓存,yii,memcached,Yii,Memcached,我已经创建了这个过滤器 return array( array( 'CHttpCacheFilter + View', 'lastModified'=>Yii::app()->db->createCommand( "SELECT MAX(`date_taken`) FROM image")->queryScalar(), ), ); 它在php Yii中缓存actionView的所有数据 问题是我

我已经创建了这个过滤器

return array(
    array(
        'CHttpCacheFilter + View',
        'lastModified'=>Yii::app()->db->createCommand(
             "SELECT MAX(`date_taken`) FROM image")->queryScalar(),
    ),
);
它在php Yii中缓存
actionView
的所有数据

问题是我在页面上有需要动态的区域

我已经查看了该页面上的部分缓存。这不会带来性能优势。主要权重是sql查询。我尝试将数据添加到缓存密钥。但是,数据超过1MB,因此这项功能无法正常工作。有谁知道最好的办法吗

/**
 * View for a Image
 * @param string $alias_title the image a user would like to view   
 */        
public function actionView($alias_title)
{
    $associated_image_details =  Image::getImageFromAliasTitle($alias_title);
    $image = Utils::getArrayOrNull($associated_image_details, 0);
    $album = Utils::getArrayOrNull($associated_image_details, 1);
    $tag= Utils::getArrayOrNull($associated_image_details, 2);
    $comment= Utils::getArrayOrNull($associated_image_details, 3);
    $media_set= Utils::getArrayOrNull($associated_image_details, 4);
    $media_gallery= Utils::getArrayOrNull($associated_image_details, 5);
    $media_group= Utils::getArrayOrNull($associated_image_details, 6);

    $this->render('view', array(
        'image' => $image, 
        'album'=>$album,
        'comment'=>$comment,
        'tag'=>$tag,
        'media_set'=>$media_set,
        'media_gallery'=>$media_gallery,
        'media_group'=>$media_group
    ));
}

主要的权重是sql查询
您是说上次修改的查询在使用部分缓存时占用了大部分时间,还是说在需要缓存的内容中,大部分时间是在执行sql查询时?我对页面缓存很熟悉,因为页面上有动态区域,例如登录用户的用户名。Memcache不会存储超过1mb的数据。页面的权重在选择完整图像集的初始操作中。上述方法