Looking for advise on best way to handle this situation:
Have pages that have up to 100 table cells that are prices which need to be looked up from another db. Adjacent table cells are part numbers. Looking for a way to look up part number prices, update page, and have the output cached.
How I’ve handled it:
* put in a special code in all price table cells ("zzp")
* made plugin to lookup pricing and update document output
This works fine, but output is not cached. I’d like to avoid the price lookup on each page request and instead cache this output and force cache refresh separately.
Is there a better way to handle this?
I’d like to keep whatever is entered into the price table cells to something simple that can be cut/pasted into all of these cells. A snippet in each cell doesn’t work (I don’t think) as I need to know where this snippet instance is in the HTML DOM when it runs.
thanks for any ideas,
---avibodha
Thinking more about this, I want to get my parsed output saved in the cached version...and I also want this same parsed output returned to the browser on that first pass when the cache file is created...
So the question is, which event(s) should I handle to make sure my changes (1) get saved, and (2) get returned to browser?
For (1), seems like OnBeforeSaveWebPageCache would do it....
Will changing $modx->documentOutput here both get saved and returned to browser? Would any other way work better?
thanks,
---avibodha