Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Disabling lazy load in Play application

By default your Play application will be fully started (compiled, Global's onStart called, etc.) only after you do http request to it.

Is there a way to disable this lazy load and make Play app compile code and do startup once application process is run?

PS: I am using Play 2.3.

UPDATE: As Ryan pointed out lazy load happens only in dev. mode. Nevertheless I still need to disable it, despite this is relevant only to apps running in dev. mode.

like image 911
Eugene Loy Avatar asked Nov 13 '14 21:11

Eugene Loy


People also ask

How do I get rid of lazy loading?

To disable lazy loading on a specific post or page, open the post or page, and in the “Cache Options” meta box, un-check the “LazyLoad for images” option. Don't forget to publish or update the post or page to save your changes.

Does lazy loading affect performance?

Lazy-loading images and video reduces initial page load time, initial page weight, and system resource usage, all of which have positive impacts on performance.

What is lazy loading in mobile app?

Lazy loading affords you and your users two major benefits: Performance improvement. With lazy loading, you use only the resources for the relevant content, eliminating unnecessary content requests, reducing the processing power for content rendering, and loading your site faster.

Should you lazy load everything?

Today, lazy loading is widely used in web applications to improve application performance. It helps developers reduce loading times, optimize data usage and improve the user experience. However, overusing lazy loading can affect the application performance negatively.


1 Answers

Lazy loading only applies in dev mode (play run). Production mode is not lazy.

https://www.playframework.com/documentation/2.3.x/Production

like image 194
Ryan Avatar answered Sep 19 '22 14:09

Ryan