After successfully creating a JSON data source using squiz page and running JS at server, it is now the bottleneck of the project - taking anywhere up to 5 seconds to compile squiz metadata schemas and print as JSON for use.
If I then take this output, save it in a file, then reference this file instead. The project renders almost instantly.
Now I am looking at taking what I have created in the Squiz page, and making it work using the REST Resource that Squiz offers, and basically using it to produce the JSON output at set time intervals.
I have used the REST resource to complete GET requests to APIs, but never to go and fetch data from inside Squiz itself.
Anyone able to steer me in the right direction?
EXAMPLE:
<script runat="server">
// Request metadata:
var a = %globals_asset_children:123456^as_asset:asset_assetid,asset_data%;
// Show output:
print(JSON.stringify(a));
</script>
Thought I might get lucky and just plonk this into the ‘process as JS’ section, but it was a pretty big pot shot attempt, and obviously didn’t work.
Thanks again.