Opti CMS Response Providers
What It Is
A way to provide alternate response sources for requests in Opti CMSStatus
Last Reviewed:
I originally wrote this as a POC for an Opti customer. They implemented an early version of this (when it was just ZIP files), so some form of it is being used in production somewhere. However, I made quite a few changes and more development after that.
Details
This began as a way to serve static websites from Opti CMS using generated HTML assets served from a zip file attached to a page.
Editors could create the concept of “virtual roots,” which were pages (nodes on the content tree) that routed “downstream” paths to other resources (not stored in Opti).
For example, if the path of a virtual root page was:
/my/page
Then a request to /my/page/a/file.html
would find a ZIP file attached to /my/page
as a media asset, and search it for a/file.html
inside of it, then send the contents of that back as the response.
It used the concept of “Partial Routers” to detect the left-hand (“real”) portion of the URL, isolate the right-hand (“fake”) portion, then map that fake portion to some resource.
The particular customer I was working with did product documentation in another system, and that system generated massive static websites, which they wanted to serve from Opti. This basically let them do that by zipping up the resulting assets and just dragging the zip file into the UI.
Afterwards, I expanded the concept to provide generic responses from anything – files on the local filesystem, proxy responses to other websites, etc. It would essentially route the “fake” part of the URL to the response provider defined by the virtual root, then return whatever came back.
There’s also functionality to modify the retrieved response before sending it back.
There’s quite a bit of documentation at the repo URL.
Here’s a video walking through it.