Take the 2-minute tour ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

Possible Duplicate:
Ideas to improve website loading speed?

My page gets performance score 79 in yslow which is not bad. Yslow says the parts I can work on are

1)

Grade F on Make fewer HTTP requests

It does make many HTTP requests but how can I make'em fewer? The page uses the facebook and gmaps API and quit using those features are kind of out of the question.

2)

Grade F on Use a Content Delivery Network (CDN)

I suppose I can but that seems like I need another hosting provider.

3)

Grade F on Add Expires headers

I tried adding expires headers in app.yaml to my stuff but it seems it's the components from other sources that don't have expires headers.

4)

Grade F on Put JavaScript at bottom

Again I'm forced to put some javascript at the top since it's the recommendation. Should I do anything special here?

5)

Grade B on Do not scale images in HTML

I suppose I could do things another way than inline style elements.

6)

Grade B on Avoid CSS expressions

I don't know what this is.

So I want to make it perform even better. Do you have any idea how to optimize this code?

{% spaceless %}{% load i18n %}<!doctype html>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:fb="http://www.facebook.com/2008/fbml">
  <head><meta http-equiv="Cache-Control" content="no-cache" /> 
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title>{% trans "Jobs" %}, {% trans "Houses" %}, {% trans "Services" %}, {% trans "Cars" %}, {% trans "Commercial properties" %},</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="date" content="{% now "l, F jS Y" %}" />
<meta name="description" content="{% trans "VEHICLES" %},{% trans "Motorcycles" %},{% trans "Apartments" %},{% trans "Houses" %},{% trans "Cars" %},{% trans "Jobs" %},{% trans "Other vehicles" %},
{% trans "PROPERTIES" %},{% trans "Houses" %},{% trans "Commercial properties" %},{% trans "Land" %},{% trans "ELECTRONICS" %},
{% trans "TV/Audio/Video/Cameras" %},{% trans "Computers" %},{% trans "Home &amp; Garden" %},{% trans "Clothes/Watches/Accessories" %},
{% trans "For Children" %},{% trans "LEISURE/SPORTS/HOBBIES" %},{% trans "Hobby &amp; Collectables" %},{% trans "Music/Movies/Books"%},
{% trans "Pets" %},{% trans "BUSINESS TO BUSINESS" %},{% trans "Professional/Office equipment" %},{% trans "Business For sale" %},{% trans "Services" %}" />
<meta name="Keywords" content="{% trans "VEHICLES" %},{% trans "Motorcycles" %},{% trans "Apartments" %},{% trans "Houses" %},{% trans "Cars" %},{% trans "Jobs" %},{% trans "Other vehicles" %},
{% trans "PROPERTIES" %},{% trans "Houses" %},{% trans "Commercial properties" %},{% trans "Land" %},{% trans "ELECTRONICS" %},
{% trans "TV/Audio/Video/Cameras" %},{% trans "Computers" %},{% trans "Home &amp; Garden" %},{% trans "Clothes/Watches/Accessories" %},
{% trans "For Children" %},{% trans "LEISURE/SPORTS/HOBBIES" %},{% trans "Hobby &amp; Collectables" %},{% trans "Music/Movies/Books"%},
{% trans "Pets" %},{% trans "BUSINESS TO BUSINESS" %},{% trans "Professional/Office equipment" %},{% trans "Business For sale" %},{% trans "Services" %}" />   
<link rel="stylesheet" href="/static/css/style.css" />
</head>
<body onload="initialize()"><div id="fb-root"></div>
<script>
  window.fbAsyncInit = function() {
    FB.init({
      appId      : '164355773607006', // App ID
      channelURL : '//WWW.KOOLBUSINESS.COM/static/channel.html', // Channel File
      status     : true, // check login status
      cookie     : true, // enable cookies to allow the server to access the session
      oauth      : true, // enable OAuth 2.0
      xfbml      : true  // parse XFBML
    });

    // Additional initialization code here
  };

  // Load the SDK Asynchronously
  (function(d){
     var js, id = 'facebook-jssdk'; if (d.getElementById(id)) {return;}
     js = d.createElement('script'); js.id = id; js.async = true;
     js.src = "//connect.facebook.net/en_US/all.js";
     d.getElementsByTagName('head')[0].appendChild(js);
   }(document));
</script>
<div class="container_12">
    <div id="mainCol" class="grid_12">
        <div id="header">
        <div id="navbar"> 
<ul><li><a href="ai">{% trans "Add" %}</a></li>
    <li><a href="li">{% now "d M" %}</a></li>                   
{% if user %}<li><a href="{{ logout_url }}" class="logout">Logout Google</a></li>{% endif %}    
{% if current_user %}<li><a href="https://www.facebook.com/logout.php?next=http://{{host}}&access_token={{current_user.access_token}}">Logout Facebook</a><li> {% endif %}
{% if not current_user and not user %}<li><a href="/login">{% trans "Log in" %}</a></li>{% endif %}
</ul>
</div>
        {% if user or current_user %}
            <div id="user-ident">
                <span>{% trans "Welcome," %} <b>{{ current_user.name }}{% if not current_user %}{{ user.nickname }}{% endif %}</span>
            </div>
            {% endif %}
            <div id="logo-wrap">
                <div id="logo-img"><a class="nobk" href="/ai"><img src="/_/img/kool_business.png" width="140" height="166" alt="Market Logo"/></a>
</script><g:plusone></g:plusone>
<div class="fb-like" data-href="{{host}}" data-send="true" data-width="450" data-show-faces="true"></div></div>
                <div id="logo-text"><h1 style="display:none">Market</h1>
</div>
            </div>
        </div>
    </div>
</div>
<div class="clear"></div>
<div>       
    <div class="mapContainer"><center>
        <div id="gmap">&nbsp;</div></center>
    </div>
<div class="container_12">
    <div class="grid_6">
        <div class="title1">{% trans "Post a photo" %}</div>
        <div class="countries_list">            
            <form method="post" action="{{form_url}}" enctype="multipart/form-data"> <div>
            <input type="file" name="file" /><input type="submit" value="{% trans "Go" %}" /></div> </form>         
        </div>
    </div>
    <div class="grid_6">
        <div class="title1">{% trans "Information" %}</div><div> {% trans "You can post ads for free. You can search for classified advertisements from professionals as well as private individuals; such as: cars, property, employment, pieces of furniture, electronics and others." %}</div>
        <div class="link_to_profile">   </div>              
    </div>
</div>
<div class="clear"></div>
<div class="container_12">
    <div class="grid_12">
        <div id="footer">
        &copy;2011 <a href="http://koolbusiness.com" title="kool business">koolbusiness.com</a> 
        </div><iframe src="https://www.facebook.com/plugins/registration.php?
             client_id=164355773607006&
             redirect_uri=http://www.koolbusiness.com/
             fields=name,birthday,gender,location,email"
        scrolling="auto"
        frameborder="no"
        style="border:none"
        allowTransparency="true"
        width="100%"
        height="330">
</iframe>
    </div>
</div>
<script type="text/javascript" src="https://apis.google.com/js/plusone.js"></script>
<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=true&libraries=adsense"></script>
<script type="text/javascript" src="static/js/home.js"></script>
</body>
</html>{% endspaceless %}
share|improve this question

migrated from stackoverflow.com Oct 30 '11 at 9:23

This question came from our site for professional and enthusiast programmers.

marked as duplicate by John Conde Oct 30 '11 at 19:30

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

1  
Looks to me like most of the highlighted issues are coming from Facebook Connect on your page mate. Wouldn't worry about it too much as I can see you've already used spriting for your own images etc. –  Gats Oct 30 '11 at 6:24

1 Answer 1

up vote 1 down vote accepted

for 1)merge all css in on file & javascript files in one file for fewer HTTP requests. merge all background into one image file and use css to devide them

2)change your host or use cloadfare.com

3)contact your script developer to fix it

4)simple:Put JavaScript at bottom: before

5)also simple: Do not scale images in HTML. resize your images in a photo editor for web use

6)compress your scc(also javascript) files.

and Ideas: use caching. both in server and on clients local memory(html5 feature)

share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.