Hi Guys,
I have a snippet that is pulling a number of resources and displaying them.
The snippet is using
$created = $x->get('createdon'); $age = time() - strtotime($created); to get the documents created date.
I'm finding that often the snippet displays an old cached date / time even though im calling the snippet uncached.
I've tried adding
$modx->cacheManager->clearCache(array(
'/resource'
)); at the top of the snippet, which seems to help, but...Is resource the best folder to clear?
If i take the approach of clearing cache each time the snippet is executed, and the snippet is used widely on the site doesnt that mean the cache is almost useless because its being cleared everytime a user hits the site?
Is there another approach to ensuring that the snippet will not display the cached version of data such as created date.