You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
You can turn off debug mode by updating +development.rb+ to include:
284
+
You can turn off debug mode by updating +config/environments/development.rb+ to include:
285
285
286
-
<erb>
286
+
<ruby>
287
287
config.assets.debug = false
288
-
</erb>
288
+
</ruby>
289
289
290
-
When debug mode is off Sprockets will concatenate and run the necessary preprocessors on all files, generating the following HTML:
290
+
When debug mode is off Sprockets concatenates and runs the necessary preprocessors on all files. With debug mode turned off the manifest above would generate instead:
Assets are compiled and cached on the first request after the server is started. Sprockets sets a +must-revalidate+ Cache-Control HTTP header to reduce request overhead on subsequent requests -- on these the browser gets a 304 (not-modified) response.
296
+
Assets are compiled and cached on the first request after the server is started. Sprockets sets a +must-revalidate+ Cache-Control HTTP header to reduce request overhead on subsequent requests -- on these the browser gets a 304 (Not Modified) response.
297
297
298
298
If any of the files in the manifest have changed between requests, the server responds with a new compiled file.
299
299
300
-
You can put +?debug_assets=true+ or +?debug_assets=1+ at the end of a URL to enable debug mode on-demand, and this will render individual tags for each file. This is useful for tracking down exact line numbers when debugging.
301
-
302
-
Debug can also be set in the Rails helper methods:
300
+
Debug mode can also be enabled in the Rails helper methods:
The +:debug+ option is ignored if the debug mode is off.
307
+
The +:debug+ option is redundant if debug mode is on.
310
308
311
309
You could potentially also enable compression in development mode as a sanity check, and disable it on-demand as required for debugging.
312
310
313
-
314
311
h3. In Production
315
312
316
313
In the production environment Rails uses the fingerprinting scheme outlined above. By default it is assumed that assets have been precompiled and will be served as static assets by your web server.
0 commit comments