简体   繁体   English

Heroku:在应用程序启动时显示自定义页面

[英]Heroku: Displaying custom page while application is starting up

Is it possible to display a static html page during dyno startup, similar to displaying a custom page on error or during maintenance mode?是否可以在 dyno 启动期间显示静态 html 页面,类似于在错误或维护模式期间显示自定义页面?

My app's slug size is rather large and startup time can take close to 50 seconds.我的应用程序的 slug 大小相当大,启动时间可能接近 50 秒。 If possible, I'd like to display something for the user to see, rather than an empty page.如果可能,我想显示一些内容供用户查看,而不是一个空白页面。 If not, I'll address the large slug size directly to minimize startup time.如果没有,我将直接解决大型 slug 大小以最小化启动时间。

Thanks for any insights!感谢您的任何见解!

No, but you might consider taking a look at the preboot options instead.不,但您可以考虑查看预引导选项 While there are some downsides (waiting several minutes for deploys to take effect) it does mean Heroku will wait until the new dynos are fully running and available before switching to them.虽然有一些缺点(等待几分钟让部署生效),但这确实意味着 Heroku 将等到新的 dynos 完全运行并可用,然后再切换到它们。

Preboot changes the standard dyno start behavior for web dynos. Preboot 更改了 Web dynos 的标准 dyno 启动行为。 Instead of stopping the existing set of web dynos before starting the new ones, preboot ensures that the new web dynos are started (and receive traffic) before the existing ones are terminated. preboot 不是在启动新的 web dynos 之前停止现有的 web dynos 集,而是确保在现有的 web dynos 终止之前启动新的 web dynos(并接收流量)。 This can contribute to zero downtime deployments.这有助于实现零停机部署。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM