概要 Herokuの無料のdynoプランでアプリをデプロイしている人も多いかと思います。 その時の問題点は30分アクセスがなければ、Herokuがスリープしてしまい、次回アクセス時にレスポンスが返ってくるのに時間がかかるという点です。無料で使わせてもらっているとはいえ、やっぱりレスポンスは速くしたい! そこで今回は、無料でもHerokuを24時間稼働させる方法を実践してまとめました。 結論 GAS(Google Apps Script)で定期的にHerokuの該当アプリにアクセスする。 具体的な内容 1. GASの設定 GASの新規プロジェクトを作成して以下のコードを準備します。シンプルに特定のurlにアクセスしているだけです。コードを設置したら一度デバッグして正常に動くか確認しましょう。なお、ファイル名はデフォルトのままでも構いません。 GASのプロジェクト作成はこちら function