How to create a static JSON files with Element API and cache it with Varnish Is it possible to create static JSON file using the Element API plugin?

What I then want to do was cache that file probably using Varnish or push it to an S3 bucket.

If I was to cache it I would need to look at purging the URL when an entry is added or edited.
If I pushed it to S3, then I would either need to overwrite the file or manage it another way.

What would be the best way to handle this, and could you easily create a static JSON file with caching and purging abilities?
Not sure how you can do this, but you could manually print the response to a file yourself on a regular basis (as a cron job) using wget:

This:

wget -S http://craft.fira/fullmembers.json


…saves the JSON into a file named fullmembers.json into the directory it was run from.

Here is the solution that I have used in a cron job that runs every minute:

wget -O - http://www.fira.co.uk/fullmembers.json &gt; /home/forge/www.fira.co.uk/public/jsoncache/fullmembers-temp.json
rm /home/forge/www.fira.co.uk/public/jsoncache/fullmembers.json
mv /home/forge/www.fira.co.uk/public/jsoncache/fullmembers-temp.json /home/forge/www.fira.co.uk/public/jsoncache/fullmembers.json