statcache icon indicating copy to clipboard operation
statcache copied to clipboard

Empty error log

Open Gallenkamp opened this issue 13 years ago • 3 comments

Hi Jason,

after MODXpo, I am trying to speed up my site. but unfortunately I cant get StatCache to work. Apache Log is Empty, MODX log is empty, statcache folder is empty.

Permissions are set to 777, I tried www-data and the ftp user as owners. No luck so far. Yes, I checkt both of the system events boxes.

Any idea where I could continue digging?

Cheers,

Guido

Gallenkamp avatar Nov 12 '12 03:11 Gallenkamp

Do you have any non-cacheable tags in your site? Any Resources that contain ANY non-cacheable tags will not be cached.

opengeek avatar Nov 12 '12 12:11 opengeek

I had the same issue so i tested with skipIfTagsRemain = No in plugin settings and the static file was created. Then i searched for the brackets "[[" in $modx->resource->_content to find all uncached tags. I was suprised to find out that the only remaining tags where [[_id:isnot=214:then=http://mysite.com/]] from the canonical url filter [[_id:isnot=[[++site_start]]:then=[[~[[*id]]]]]] . I deleted the canonical url rule since its really obsolete for my site and everything worked fine.

ghost avatar Nov 27 '12 23:11 ghost

Placeholders with the :isnot output filter and with a value equal to the isnot value can be found partly proccessed when searching $modx->resource->_content. Then during $modx->cacheManager->writeFile($statcacheFile, $modx->resource->_output) the placeholders are fully processed so they don’t exist in the final html file.

Example 1. (remaining tags) [[+placeholder]] has value equal to 'something' Inside Template: [[+placeholder:isnot=something:then=[[placeholder]]:else=[[+placeholder2]]]] Inside $modx->resource->_content : [[+placeholder:isnot=something:then=something:else=placeholder2value]] After $modx->cacheManager->writeFile($statcacheFile, $modx->resource->_output) : something

Example 2. (no remaining tags) [[+placeholder]] has value equal to 'randomstring' Inside Template: [[+placeholder:isnot=something:then=[[placeholder]]:else=[[+placeholder2]]]] Inside $modx->resource->_content : randomstring After $modx->cacheManager->writeFile($statcacheFile, $modx->resource->_output) : randomstring

It seems to me that until this issue is resolved someone has two choices, to disable the skipIfTagsRemain and inspect manually for uncached tags or to avoid output filters.

ghost avatar Nov 28 '12 01:11 ghost