After some Chrome debugging I noticed it takes nearly 6 seconds to wake up which is not acceptable.
There are about 5 - 10 ways to keep it awake depending upon how you are counting: A google search pulls up a myriad of sites and ways to do this.
Some methods suggest regular pinging while others suggest regular GET requests.
I went with regular GET requests as it is just a small file to add to my server:
const http = require("http");
let INTERVAL = 300000; // 5 minute, keep a let for debugging
INTERVAL = 600000; // 10 minutes
const SITE = "http://www.your-site.ai";
let count = 0;
setInterval( () => {
count++;
wakeSite();
}, INTERVAL);
function wakeSite() {
const output = http.get(SITE);
console.log('DEBUG: ' + count);
}
function interface () {}
wakeSite();
module.exports = interface;
What should I set INTERVAL to and where is this documented in the Heroku documentation?
According to this Heroku article from 7 years ago, apps go to sleep after 1 hour.
Is this still valid and what wakes an app up? A simple ping request or does it need to be a full GET. Does Heroku support regular "josteling" of the app?