We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 31246 ☆ A M B ☆
    • 428 Posts
    Hi,
    I have this problem.
    I take the file from the cache when rendering the resource uncached snippet does not work out.
    For example.
    if($modx->getCacheManager() && isset($cache)){
      // Creates a key, unique key will be created depending on the parameters passed to the function.
      $keynav = md5('pagenav::'.implode(":",$properties));
      if ($cachnav = $modx->cacheManager->get($keynav,array(
    		xPDO::OPT_CACHE_KEY => 'pagenav'
    		))){
        $modx->setPlaceholder($prefPles.'nav',$cachnav['outPl']);
        return $cachnav['output'];
      }else{
        $inCache = false;
      }
    }

    This file is part of the $cachnav['output'] code:
    Lorem ipsum dolor sit amet, consectetur adipiscing elit. [[!Snippet? &id=`128`]] Lorem ipsum dolor sit amet, consectetur adipiscing elit.

    Here is the snippet
    [[!Snippet? &id=`128`]]
    outputs the result to the cache.
    How to run it?
    thanks in advance. [ed. note: valikras last edited this post 14 years, 4 months ago.]
      Valentin Rasulov - Industrial design (Hobbies - Web Development)
      Development not standard projects on CMF MODx Revolution.
      Small sample of extensions
      • 31246 ☆ A M B ☆
      • 428 Posts
      Can be solved through the parser, but this is not an option, as in a single file cache stored for about 15 of these snippets (the output directory using getResources), you need to handle each separately.

      You can certainly call pagination not to cache (its pagination pages). Then work well. Since resources are often added (once a day), I decided to create one as follows: in the event OnDocFormSave check the resource tree (getParentIds), if the identifiers of there, then delete the folder with our cache (in my case - the folder pagenav).
        Valentin Rasulov - Industrial design (Hobbies - Web Development)
        Development not standard projects on CMF MODx Revolution.
        Small sample of extensions