Hello,
I've taken a look at the source code of one of my nodes and much to my surprise there's excessive coding in the HEAD tag that isn't needed for the page being viewed.
For example.. it's placed code for modules that aren't on this page such as ratings, forum css, mp3 player, aggregator, photos, follow us.... all of this is set in the header on the page and this page doesn't require any of that.
What I think is that it's making the page take longer to load, especially when viewed via mobile device even when the .mobi theme is set. Also I think it's ruining my optimization with search engines since supposedly spider/bots only read about '300 words' into pages and if no 'good content' is encountered, it abandons the indexing and moves along elsewhere.
Below is a sample code for the HEAD tag for one of my nodes. Can anyone please let me know if I can remove the excessive code from the pages where it's not needed.
Thank you for your time.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en" dir="ltr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Title I removed</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="shortcut icon" href="/favicon.ico" type="image/x-icon" />
<meta name="keywords" content="keywords I removed" />
<meta name="description" content="Description I removed" />
<b> <link type="text/css" rel="stylesheet" media="all" href="/modules/aggregator/aggregator.css?t" /></b>
<link type="text/css" rel="stylesheet" media="all" href="/modules/node/node.css?t" />
<link type="text/css" rel="stylesheet" media="all" href="/modules/system/defaults.css?t" />
<link type="text/css" rel="stylesheet" media="all" href="/modules/system/system.css?t" />
<link type="text/css" rel="stylesheet" media="all" href="/modules/system/system-menus.css?t" />
<link type="text/css" rel="stylesheet" media="all" href="/modules/user/user.css?t" />
<link type="text/css" rel="stylesheet" media="all" href="/sites/all/modules/cck/theme/content-module.css?t" />
<link type="text/css" rel="stylesheet" media="all" href="/sites/all/modules/drupalit/drupalit.css?t" />
<link type="text/css" rel="stylesheet" media="all" href="/sites/all/modules/filefield/filefield.css?t" />
<b><link type="text/css" rel="stylesheet" media="all" href="/sites/all/modules/fivestar/css/fivestar.css?t" /></b>
<b><link type="text/css" rel="stylesheet" media="all" href="/sites/all/modules/fivestar/widgets/flames/flames.css?t" /></b>
<link type="text/css" rel="stylesheet" media="all" href="/sites/all/modules/photos/thickbox/thickbox.css?t" />
<b><link type="text/css" rel="stylesheet" media="all" href="/sites/all/modules/photos/css/photos.css?t" /></b>
<b><link type="text/css" rel="stylesheet" media="all" href="/modules/forum/forum.css?t" /></b>
<link type="text/css" rel="stylesheet" media="all" href="/sites/all/modules/addtoany/addtoany.css?t" />
<link type="text/css" rel="stylesheet" media="all" href="/modules/comment/comment.css?t" />
<b><link type="text/css" rel="stylesheet" media="all" href="/sites/all/modules/follow/follow.css?t" /></b>
<link type="text/css" rel="stylesheet" media="all" href="/themes/colorpaper-editted/style.css?t" />
<script type="text/javascript" src="/misc/jquery.js?t"></script>
<script type="text/javascript" src="/misc/drupal.js?t"></script>
<script type="text/javascript" src="/sites/all/modules/drupalit/drupalit.js?t"></script>
<b><script type="text/javascript" src="/sites/all/modules/fivestar/js/fivestar.js?t"></script></b>
<b><script type="text/javascript" src="/sites/all/modules/mp3player/mp3player/audio-player.js?t"></script></b>
<b><script type="text/javascript" src="/sites/all/modules/photos/js/photos.js?t"></script></b>
<script type="text/javascript" src="/sites/all/modules/photos/js/jquery.jeditable.pack.js?t"></script>
<script type="text/javascript" src="/sites/all/modules/photos/thickbox/thickbox-compressed.js?t"></script>
<script type="text/javascript" src="/themes/colorpaper-editted/pngfix.js?t"></script>
<script type="text/javascript">
<b><!--//--><![CDATA[//><!--
jQuery.extend(Drupal.settings, { "basePath": "/", "fivestar": { "titleUser": "Your rating: ", "titleAverage": "Average: ", "feedbackSavingVote": "Saving your vote...", "feedbackVoteSaved": "Your vote has been saved.", "feedbackDeletingVote": "Deleting your vote...", "feedbackVoteDeleted": "Your vote has been deleted." } });
//--><!]]>
</script>
<script type="text/javascript">
<!--//--><![CDATA[//><!--
AudioPlayer.setup("/sites/all/modules/mp3player/mp3player/player.swf", {width:290,noinfo: "yes",transparentpagebg: "yes"});
//--><!]]>
</script></b>
<script type="text/javascript">$(document).ready( function() { $('#logo, .feed-icon').pngFix(); } );</script>
<script type="text/javascript"></script>
</head>
Comments
CSS aggregation
Turn on css aggregation at admin/settings/performance.
Wow that's incredible... it
Wow that's incredible... it shrunk it down to this:
Major Thanks!!
Anyone else know if there's a way to remove the javascripts for the mp3 player and fivestar modules ??
Thanks again YelV
The browser still fetches all
The browser still fetches all the CSS files before it can load the page. This is pretty bad for loading performance.
Any solution to remove unnecessary CSS stylesheet?