WebFaction
Community site: login faq

Hi there,

I'm working on my first web(facebook) app (www.shopperspoll.com), and was wondering how I can go about making the pages load faster. Sorry that the main page is a mess now, started making some major changes yesterday, but you'll notice that it takes a really long for the page to load. I was wondering if that has something to do with the way I've set Django up on Webfaction, or something else. If you could give me some pointers on how I can go about making it faster, I'd really appreciate it!

Thanks!

asked 26 Feb '12, 13:31

iman453
491527
accept rate: 0%


Hello,

The app is built on many layers,

The Django back-end,

Facebook,

And The Javascript rendered in the browser.

You as the developer would have to break your app up into pieces and test the independent pieces as the issue could be with any one of them.

From looking at the front-end info alone and using Google Chrome Developer tools I notice a recurring request being made by your javascript and timing out,

pull
2-jk-w.channel.facebook.com

Isolate what that is and stop it from timing out to see if that is the issue.

Test the independent parts of your app,

For Django use curl to make the requests your java script is supposed to be making and verify it is fast.

For Facebook you would have to contact them, but I doubt the issue is there.

You should test the Javascript logic in a local environment with simulated data from your app to test its load times.

permanent link

answered 26 Feb '12, 17:20

johns
5.4k312
accept rate: 23%

Thanks a lot for your reply :) I see the request you mentioned. Is there any easy way of finding out what part of my app is doing that request? I'm using a python/django library to hook up the web app with facebook, but this request is from a javascript file you said? So it couldn't be from the library could it? Thanks again for your help, I really appreciate it!

(27 Feb '12, 22:20) iman453

I could not tell you more information without seeing the source code with notes on its supposed function. If you wanted us to take a look you may submit a support ticket. I suggest you include The URLs and requests your javascript makes to the Django server so we can reproduce the requests sent to it in real-time. You will also want to search Facebook's support for more info as the request appears to be related to their networks.

Request URL:http://0-jk-w.channel.facebook.com/pull?channel=p_100002401606487&seq=1&clientid=6065fe60&cb=ktkx&idle=3&state=active
Request Method:GET

Actually visiting the URL does produce a result, but without knowing more about how the code is supposed to work and seeing clear examples its tough to say what it is exactly.

(28 Feb '12, 00:59) johns

Hi johns...I'm very sorry for the late reply! I tried running an audit of my page like you mentioned, and the only big chunk I see (besides that pull request which I have no clue where it's coming in, but has been pushed to the bottom, so I think it just does it after the page loads) is this post request to the server, which I'm guessing get's all the content of the page (not sure why it's a POST request though). Though when I take a look at that, most of the time is spent waiting (I've attached a screenshot here, http://i.imgur.com/o6CCa.jpg) I timed the code in the backend, and the views only take around .2 seconds. Would you know why it's waiting so long?

Sorry, I would show ya'll the source code, but I'm new to programming and it's all soo messy. The app is basically being held together by a lot of tape and a prayer :)

Also, when you said use curl to test the javascript, does that I mean I use it to test the times of the AJAX part I have, cause that's the only time the javascript code would talk to the server, right?

Once again, sorry if my questions are annoying/stupid and thanks a million for your help!

(20 Mar '12, 23:26) iman453

(If you'd rather I open a ticket, I can go ahead and do that)

(20 Mar '12, 23:29) iman453

You may submit a ticket, but I am not sure I would be able to tell you why the app takes so long to load even seeing the source.

As stated before you need to test each 'piece' of the code to find the bottleneck and only you would know what the 'pieces' are since you built it.

What I meant by using curl is to basically load the parts of the site hosted on our platform without loading them in a facebook app, but getting the info directly. However you say you timed the code in the view and the back-end and it was fast, which is what the idea behind using curl was.

In my opinion the site is not loading that slowly anymore, considering the amount of JavaScript the application processes the site is loading quickly.

(21 Mar '12, 00:35) johns

Thanks johns..really appreciate your help

(21 Mar '12, 01:52) iman453

I'm actually mainly concerned about the wait time now though. For example, when I click the next arrow, and check chrome, there's a 3 second wait before it's hitting the server. Would that be because of the way I've set up my app on webfaction? I've attached a screenshot here http://i.imgur.com/plvUV.jpg

(21 Mar '12, 02:00) iman453
showing 5 of 7 show 2 more comments
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×12
×9
×6

question asked: 26 Feb '12, 13:31

question was seen: 2,341 times

last updated: 21 Mar '12, 02:00

WEBFACTION
REACH US
SUPPORT
AFFILIATE PROGRAM
LEGAL
© COPYRIGHT 2003-2019 SWARMA LIMITED - WEBFACTION IS A SERVICE OF SWARMA LIMITED
REGISTERED IN ENGLAND AND WALES 5729350 - VAT REGISTRATION NUMBER 877397162
5TH FLOOR, THE OLD VINYL FACTORY, HAYES, UB3 1HA, UNITED KINGDOM