i’m using getResources, getPage, getReqParam and custom snippet based on getReqParam:
[[!getPage?
&elementClass=`modSnippet`
&element=`getResources`
&parents=`31`
&depth=`1`
&limit=`[[!If?
&subject=`[[!getReqParam? &name=`limit` &type=`POST`]]`
&operator=`notempty`
&then=`[[!getReqParam? &name=`limit` &type=`POST`]]`
&else=`5`
]]`
&pageVarKey=`page`
&where=`[[!getCustomReqParam]]`
&includeTVs=`1`
&tvFilters=`[[!If?
&subject=`[[!getReqParam? &name=`cat` &type=`POST`]]`
&operator=`notempty`
&then=`newsCategory==[[!getReqParam? &name=`cat` &type=`POST`]]`
&else=``
]]`
&includeContent=`1`
&tpl=`news`
]]
looks kinda monstrous but it works just fine but only for the first request. i set this resource to be non-cached. So revo doesn’t create 31.cache.php in cache/web but still creates folder 31\1 where it puts "d41d8cd98f00b204e9800998ecf8427e.cache.php" file with something like that:
<?php return array (
'properties' =>
array (
'namespace' => '',
'limit' => 5,
'offset' => 0,
'page' => 1,
'pageVarKey' => 'page',
'totalVar' => 'total',
'pageLimit' => 5,
'elementClass' => 'modSnippet',
'pageNavVar' => 'page.nav',
'pageNavTpl' => '<li[[+classes]]><a[[+classes]][[+title]] href="[[+href]]">[[+pageNo]]</a></li>',
'pageActiveTpl' => '<li[[+activeClasses]]><a[[+activeClasses:default=` class="active"`]][[+title]] href="[[+href]]">[[+pageNo]]</a></li>',
'pageFirstTpl' => '<li class="control"><a[[+classes]][[+title]] href="[[+href]]">First</a></li>',
'pageLastTpl' => '<li class="control"><a[[+classes]][[+title]] href="[[+href]]">Last</a></li>',
'pagePrevTpl' => '<li class="control"><a[[+classes]][[+title]] href="[[+href]]"><<</a></li>',
'pageNextTpl' => '<li class="control"><a[[+classes]][[+title]] href="[[+href]]">>></a></li>',
'element' => 'getResources',
'parents' => '31',
'depth' => '1',
'where' => '{"pagetitle:LIKE":"%новость%"}',
'includeTVs' => '1',
'tvFilters' => '',
'includeContent' => '1',
'tpl' => 'news',
'total' => 1,
'toPlaceholder' => '',
'cache' => true,
'cache_key' => 'default',
'cache_handler' => 'xPDOFileCache',
'cache_expires' => 0,
'cachePageKey' => 'web/resources/31/1/d41d8cd98f00b204e9800998ecf8427e',
'cacheOptions' =>
array (
'cache_key' => 'default',
'cache_handler' => 'xPDOFileCache',
'cache_expires' => 0,
),
'qs' =>
array (
),
'pageCount' => 1,
'firstItem' => 1,
'lastItem' => 1,
'pageUrl' => 'novosti-kompanii/',
),
'output' => '<br style="clear:both;" />
<span class="parent hidden">3</span>
<div class="news" id="nid53">
<h1>Новость 1</h2>
<h3>Sep 09 2010</h3>
<p align="center"></p>
<a class="opener" rel="">показать полный текст</a>
<div class="hiddenNews">
Полный текст 1
</div>
</div> ',
);
I figured out that that cache_expires was set to 0 and i set it to 2 secs, it seems to solve my problem BUT it also renders cache mechanisms useless. Who needs cache with 2 seconds life-time?
Now the question is: how do i COMPLETELY disable cache only for one page? i created simple snippet with
<?php
$modx->cacheManager->clearCache();
but it seems that i missed something.