We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 46580
    • 167 Posts
    After having read JSON PHP templating was the best solution to output JSON data, I added a new method to JSONderulo snippet in order to template Resourcespace (www.resourcespace.org/) API search JSON results:

        [[!JSONDerulo?
            &feed=`rs`
            &apiKey=`[[++rs_api_key]]`
            &tpl=`wjd.rs`
            &limit=`100`
            &cacheTime=`86400`
            &cacheName=`rs`
            &search=`[[!paramStash? ¶ms=`k` &valueOnly=`1`]]`
            &cacheName=`wrs-jsonderulo-cache`
        ]]
    


    It works as excepted and the snippet create files in MODX cache :


    It's around 5-6 sec to perform a search and display images !

    But... It seems to me abnormally slow to render:



    I do an another test with javascript templating / client side and the result is better and image display is really fast :



    Obviously the query and JSON file are exactly the same.

    Now, the question : Is normal to have a such difference and a better response time with javascript templating in comparison to PHP/snippet templating ?

    I would prefer the MODX snippet / chunk design way but regarding performance it's really bad... [ed. note: johnxx last edited this post 11 years ago.]
      MODX lover
      -
      Développeur MODX / Webdesign / Solutions web
      • 47401
      • 295 Posts
      it would be interesting if a report could be done on the quantity of sql requests, and the time it takes for each query.
        • 47401
        • 295 Posts
        ps, the ! at the start of the block of code is telling modx not to cache it therefor this would slow down the process