We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 54163
    • 24 Posts
    I try to stay away from PHP as much as possible by making static content with MODX, and then have filewatchers optimize it further by peeling of unused css and prezip it onto disk. It's a costly one time process, but after that speed is free. To get a personalized look for a logged in user I let MODX (it could be Dovecot imap server or any other application) store encoded data in shareable memory. At first in memcache, now just in a file on a memory mapped filesystem. Then get that data in Nginx and process it with Lua to set a cookie, and finally some javascript in the browser to decode the cookie and modify the page.

    With a number of tricks it's possible to get huge throughput from the server and still have a dynamic look. My problem is just that sometimes I think it's hard or impossible to split CRUD into R and CUD with a lot of Extras, even with the use of AJAX. Am I correct?

    So I guess this post is a way of asking developers to think about Extra design and not put the brakes on speed junkies. In pratice it means a special location for things that touch the database, and a mechanism for them to update the resource on disk. The key is how to tie a certain resource id to both.

    An example (not sure if I missed something):
    [[!QuipReply? &thread=`myThread` &moderatorGroup=`Moderators`]]

    can't be used in a page of its' own to be called from every other page that has Quip. I have solved it with a patch to let QuipReply get the id from $_REQUEST, and have AJAX know the page's resorce id from <html data-docid="[[*id]]"> in the template.

    Anyone else down this trail? I can share some code for the interested. But what if I decide to make a brand new Extra. Is REST best? [ed. note: alipang last edited this post 5 years, 6 months ago.]
      Fake News is powered by MODX — https://fakenews.com/