Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

skip precompiling of all assets on the first request for any asset #29902

Merged
merged 1 commit into from
Jul 25, 2019

Conversation

davidsbailey
Copy link
Member

@davidsbailey davidsbailey commented Jul 24, 2019

follow-on to #29878. via simple but hard-to-find configuration change, tell rails sprockets to just compile assets on demand rather then compiling every asset on the first request for any asset.

This further reduces the time to load the first request to http://localhost-studio.code.org:3000/home from 72 seconds to 13 seconds (!!) according to development.log.

super-unhelpful documentation for this setting:

config.assets.check_precompiled_asset

When enabled, an exception is raised for missing assets. This option is enabled by default.

Copy link
Contributor

@islemaster islemaster left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Whoa. How did you figure this out?

@davidsbailey
Copy link
Member Author

Whoa. How did you figure this out?

Hours (!!) of reading on the internet about how people have tackled various rails sprockets slownesses.

Copy link
Contributor

@islemaster islemaster left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should totally open a PR against the https://github.com/rails/sprockets-rails README improving their docs for this option!

@davidsbailey
Copy link
Member Author

this is the issue that ultimately led to discovering this setting: rails/sprockets-rails#352

@davidsbailey
Copy link
Member Author

You should totally open a PR against the https://github.com/rails/sprockets-rails README improving their docs for this option!

rails/sprockets-rails#441

@davidsbailey davidsbailey changed the base branch from without-associated-models to staging July 25, 2019 06:17
@davidsbailey davidsbailey merged commit a598b21 into staging Jul 25, 2019
@davidsbailey davidsbailey deleted the skip-asset-precompile branch July 25, 2019 06:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants