However, it’s often the case that contributed or custom themes will add small (or even large) JavaScript files to every page for every user via the scripts property in. If it’s not necessary, loading no JavaScript at all saves the most possible HTTP requests (no requests are better than any nonzero number of requests), as well as other overhead such as initialization of jQuery.ĭrupal 6 and Drupal 8 will not add any core JavaScript to the page if no modules or themes add their own (this isn’t the case for Drupal 7 at the time of writing, but see for a core bug report). If there are no JavaScript-heavy features such as carousels or slideshows on these pages, the first thing to check is whether any JavaScript is loaded at all. Once you’re ready, look at the CSS and JavaScript requests in a tool such as Firebug or Chrome Developer Tools. Do not look for performance issues while logged in as an administrator unless you’re specifically trying to find issues affecting administrators, since toolbars, contextual links, and the like add a lot of page weight that will often show up as frontend (and sometimes backend) performance issues, obscuring issues that affect users without access to those features. This allows you to see all the individual CSS and JavaScript files being added to the page. When auditing, start by disabling JavaScript and CSS aggregation, then view the pages as either an anonymous user or an authenticated user. What you audit depends on your priorities for optimization. Ideally these will be the most popular types of page on the site-for example, article pages or user profiles, as well as a landing page such as the front page. When identifying bottlenecks, select two or three pages of different types to start with. As with many other Drupal performance issues, the most common cause of problems is particular combinations of configuration and site structure and how these interact with modules that are unable to know exactly how they’re used on every individual site. This, however, doesn’t mean that the site itself is running with a small amount of JavaScript or CSS, as both core and contributed modules provide their own files. Many Drupal sites operate without any custom JavaScript and, if using a stock contributed theme or base theme, may only have a small amount of custom CSS.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |