Where to put css and javascript [closed]










-4














If I understand Google encourages to put the css and javascript in the same page that the html. Internal css but not inline. On the other side, all the manuals and tutorials I have read say that I should use an external document.



Where should I put the css and javascript?



Note: in the design o my page there it makes no difference to use the css and javascript of the "above the folder" internal and the rest external. 90% or more of the css and javascript is for the content above the folder. In my case, it makes no sense make a distinction.



https://developers.google.com/speed/pagespeed/insights/
Resources are blocking the first paint of your page. Consider delivering critical JS/CSS inline and deferring all non-critical JS/styles



https://developers.google.com/web/tools/lighthouse/audits/critical-request-chains










share|improve this question















closed as too broad by dippas, Peter B, Michael Dodd, ekad, Makyen Nov 12 '18 at 16:52


Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.










  • 1




    Can you tell us what led you to the conclusion in your first sentence?
    – Manos Kounelakis
    Nov 12 '18 at 16:22






  • 1




    Possible duplicate of When should I use Inline vs. External Javascript?
    – Peter B
    Nov 12 '18 at 16:26










  • @Mano Kounelakis. I updated the question with the Google links that led me to that conclusion
    – Nrc
    Nov 12 '18 at 16:29















-4














If I understand Google encourages to put the css and javascript in the same page that the html. Internal css but not inline. On the other side, all the manuals and tutorials I have read say that I should use an external document.



Where should I put the css and javascript?



Note: in the design o my page there it makes no difference to use the css and javascript of the "above the folder" internal and the rest external. 90% or more of the css and javascript is for the content above the folder. In my case, it makes no sense make a distinction.



https://developers.google.com/speed/pagespeed/insights/
Resources are blocking the first paint of your page. Consider delivering critical JS/CSS inline and deferring all non-critical JS/styles



https://developers.google.com/web/tools/lighthouse/audits/critical-request-chains










share|improve this question















closed as too broad by dippas, Peter B, Michael Dodd, ekad, Makyen Nov 12 '18 at 16:52


Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.










  • 1




    Can you tell us what led you to the conclusion in your first sentence?
    – Manos Kounelakis
    Nov 12 '18 at 16:22






  • 1




    Possible duplicate of When should I use Inline vs. External Javascript?
    – Peter B
    Nov 12 '18 at 16:26










  • @Mano Kounelakis. I updated the question with the Google links that led me to that conclusion
    – Nrc
    Nov 12 '18 at 16:29













-4












-4








-4







If I understand Google encourages to put the css and javascript in the same page that the html. Internal css but not inline. On the other side, all the manuals and tutorials I have read say that I should use an external document.



Where should I put the css and javascript?



Note: in the design o my page there it makes no difference to use the css and javascript of the "above the folder" internal and the rest external. 90% or more of the css and javascript is for the content above the folder. In my case, it makes no sense make a distinction.



https://developers.google.com/speed/pagespeed/insights/
Resources are blocking the first paint of your page. Consider delivering critical JS/CSS inline and deferring all non-critical JS/styles



https://developers.google.com/web/tools/lighthouse/audits/critical-request-chains










share|improve this question















If I understand Google encourages to put the css and javascript in the same page that the html. Internal css but not inline. On the other side, all the manuals and tutorials I have read say that I should use an external document.



Where should I put the css and javascript?



Note: in the design o my page there it makes no difference to use the css and javascript of the "above the folder" internal and the rest external. 90% or more of the css and javascript is for the content above the folder. In my case, it makes no sense make a distinction.



https://developers.google.com/speed/pagespeed/insights/
Resources are blocking the first paint of your page. Consider delivering critical JS/CSS inline and deferring all non-critical JS/styles



https://developers.google.com/web/tools/lighthouse/audits/critical-request-chains







javascript css pagespeed






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 12 '18 at 16:28

























asked Nov 12 '18 at 16:21









Nrc

3,986103777




3,986103777




closed as too broad by dippas, Peter B, Michael Dodd, ekad, Makyen Nov 12 '18 at 16:52


Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.






closed as too broad by dippas, Peter B, Michael Dodd, ekad, Makyen Nov 12 '18 at 16:52


Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.









  • 1




    Can you tell us what led you to the conclusion in your first sentence?
    – Manos Kounelakis
    Nov 12 '18 at 16:22






  • 1




    Possible duplicate of When should I use Inline vs. External Javascript?
    – Peter B
    Nov 12 '18 at 16:26










  • @Mano Kounelakis. I updated the question with the Google links that led me to that conclusion
    – Nrc
    Nov 12 '18 at 16:29












  • 1




    Can you tell us what led you to the conclusion in your first sentence?
    – Manos Kounelakis
    Nov 12 '18 at 16:22






  • 1




    Possible duplicate of When should I use Inline vs. External Javascript?
    – Peter B
    Nov 12 '18 at 16:26










  • @Mano Kounelakis. I updated the question with the Google links that led me to that conclusion
    – Nrc
    Nov 12 '18 at 16:29







1




1




Can you tell us what led you to the conclusion in your first sentence?
– Manos Kounelakis
Nov 12 '18 at 16:22




Can you tell us what led you to the conclusion in your first sentence?
– Manos Kounelakis
Nov 12 '18 at 16:22




1




1




Possible duplicate of When should I use Inline vs. External Javascript?
– Peter B
Nov 12 '18 at 16:26




Possible duplicate of When should I use Inline vs. External Javascript?
– Peter B
Nov 12 '18 at 16:26












@Mano Kounelakis. I updated the question with the Google links that led me to that conclusion
– Nrc
Nov 12 '18 at 16:29




@Mano Kounelakis. I updated the question with the Google links that led me to that conclusion
– Nrc
Nov 12 '18 at 16:29












1 Answer
1






active

oldest

votes


















1














There is marginal performance improvement in combining html, css, and javascript in a single document. This theoretical performance boost is outweighed by the many complicating factors that come from trying to do this. You might be saving 20-40ms by combining documents, which is generally not something the end user can detect. You will find more important performance improvements in many other ways.



Merging documents, when done at all, should be acccomplished by using a server-side assembly process so that your code can be well partitioned and well maintained. An example of this is webpack.



But again, unless there is some specialized use case that makes this important, it is not standard practice.






share|improve this answer



























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    1














    There is marginal performance improvement in combining html, css, and javascript in a single document. This theoretical performance boost is outweighed by the many complicating factors that come from trying to do this. You might be saving 20-40ms by combining documents, which is generally not something the end user can detect. You will find more important performance improvements in many other ways.



    Merging documents, when done at all, should be acccomplished by using a server-side assembly process so that your code can be well partitioned and well maintained. An example of this is webpack.



    But again, unless there is some specialized use case that makes this important, it is not standard practice.






    share|improve this answer

























      1














      There is marginal performance improvement in combining html, css, and javascript in a single document. This theoretical performance boost is outweighed by the many complicating factors that come from trying to do this. You might be saving 20-40ms by combining documents, which is generally not something the end user can detect. You will find more important performance improvements in many other ways.



      Merging documents, when done at all, should be acccomplished by using a server-side assembly process so that your code can be well partitioned and well maintained. An example of this is webpack.



      But again, unless there is some specialized use case that makes this important, it is not standard practice.






      share|improve this answer























        1












        1








        1






        There is marginal performance improvement in combining html, css, and javascript in a single document. This theoretical performance boost is outweighed by the many complicating factors that come from trying to do this. You might be saving 20-40ms by combining documents, which is generally not something the end user can detect. You will find more important performance improvements in many other ways.



        Merging documents, when done at all, should be acccomplished by using a server-side assembly process so that your code can be well partitioned and well maintained. An example of this is webpack.



        But again, unless there is some specialized use case that makes this important, it is not standard practice.






        share|improve this answer












        There is marginal performance improvement in combining html, css, and javascript in a single document. This theoretical performance boost is outweighed by the many complicating factors that come from trying to do this. You might be saving 20-40ms by combining documents, which is generally not something the end user can detect. You will find more important performance improvements in many other ways.



        Merging documents, when done at all, should be acccomplished by using a server-side assembly process so that your code can be well partitioned and well maintained. An example of this is webpack.



        But again, unless there is some specialized use case that makes this important, it is not standard practice.







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Nov 12 '18 at 16:28









        bluejack

        198112




        198112













            這個網誌中的熱門文章

            How to read a connectionString WITH PROVIDER in .NET Core?

            Node.js Script on GitHub Pages or Amazon S3

            Museum of Modern and Contemporary Art of Trento and Rovereto