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

merge js files has no effect #2925

Closed
markshust opened this issue Jan 8, 2016 · 4 comments
Closed

merge js files has no effect #2925

markshust opened this issue Jan 8, 2016 · 4 comments
Assignees

Comments

@markshust
Copy link
Contributor

See this page for webpagetest results:
http://www.webpagetest.org/result/160108_GR_A6S/

It doesn't appear the dev/js/merge_files has any effect. I expect that this toggled on would only show a few js files at most (if not one file).

@markshust
Copy link
Contributor Author

Here's full run-down of core-config if needed for diagnosis:

mysql> select * from core_config_data;
+-----------+---------+----------+-----------------------------------------+----------------------------------------------------------------------------------------+
| config_id | scope   | scope_id | path                                    | value                                                                                  |
+-----------+---------+----------+-----------------------------------------+----------------------------------------------------------------------------------------+
|         1 | default |        0 | web/unsecure/base_url                   | http://magento-2-0-demo.mageinferno.com/                                               |
|         2 | default |        0 | general/region/display_all              | 1                                                                                      |
|         3 | default |        0 | general/region/state_required           | AT,BR,CA,CH,DE,EE,ES,FI,FR,LT,LV,RO,US                                                 |
|         4 | default |        0 | catalog/category/root_id                | NULL                                                                                   |
|         5 | default |        0 | sales/msrp/enabled                      | 1                                                                                      |
|         6 | default |        0 | carriers/tablerate/active               | 1                                                                                      |
|         7 | default |        0 | carriers/tablerate/condition_name       | package_value                                                                          |
|         8 | default |        0 | design/theme/theme_id                   | 2                                                                                      |
|         9 | default |        0 | design/head/includes                    | <link  rel="stylesheet" type="text/css"  media="all" href="{{MEDIA_URL}}styles.css" /> |
|        10 | default |        0 | dev/front_end_development_workflow/type | server_side_compilation                                                                |
|        11 | default |        0 | dev/restrict/allow_ips                  | NULL                                                                                   |
|        12 | default |        0 | dev/debug/template_hints_storefront     | 0                                                                                      |
|        13 | default |        0 | dev/debug/template_hints_admin          | 0                                                                                      |
|        14 | default |        0 | dev/debug/template_hints_blocks         | 0                                                                                      |
|        15 | default |        0 | dev/template/allow_symlink              | 0                                                                                      |
|        16 | default |        0 | dev/template/minify_html                | 0                                                                                      |
|        17 | default |        0 | dev/translate_inline/active             | 0                                                                                      |
|        18 | default |        0 | dev/translate_inline/active_admin       | 0                                                                                      |
|        19 | default |        0 | dev/js/merge_files                      | 1                                                                                      |
|        20 | default |        0 | dev/js/enable_js_bundling               | 0                                                                                      |
|        21 | default |        0 | dev/js/minify_files                     | 1                                                                                      |
|        22 | default |        0 | dev/js/translate_strategy               | dictionary                                                                             |
|        23 | default |        0 | dev/js/session_storage_logging          | 0                                                                                      |
|        24 | default |        0 | dev/js/session_storage_key              | collected_errors                                                                       |
|        25 | default |        0 | dev/css/merge_css_files                 | 1                                                                                      |
|        26 | default |        0 | dev/css/minify_files                    | 1                                                                                      |
|        27 | default |        0 | dev/image/default_adapter               | GD2                                                                                    |
|        28 | default |        0 | dev/static/sign                         | 0                                                                                      |
|        29 | default |        0 | dev/grid/async_indexing                 | 0                                                                                      |
+-----------+---------+----------+-----------------------------------------+----------------------------------------------------------------------------------------+

MAGE_MODE is set to production and all static assets were compiled.

@aoldoni
Copy link
Contributor

aoldoni commented Jan 14, 2016

Please try changing "dev/js/enable_js_bundling" to 1. I think the merging just merges files not using require.js. For all other files, this it still makes the require.js to inject them via script tags in the head tag. This causes the browser to download the remaining files separately and asynchronously.

@pynej
Copy link

pynej commented Jun 9, 2016

Yes, merge_files doesn't do much as it just merges js in the layout head section. The bundling in theory supposed to merge and optimize other js that loads through requireJs but I believe there are still issues with it.
#4506

@guz-anton
Copy link
Contributor

#2563 (comment)

Merge JavaScript Files to Yes currently merges only js files added to <head> explicitly.
You can open page source (Ctrl+U). And find that instead of several files (../requirejs/require.js, ../mage/requirejs/mixins.js, ../requirejs-config.js) you have something like static/_cache/merged/26a...e.js.

If you want to reduce number of request to different static files try to set
Enable Javascript Bundling to Yes and setup Magento mode to production.

Not a bug.
cc @almarchenko

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

No branches or pull requests

5 participants