3MB traffic for one request?

Everything else that doesn't fall into one of the other categories.
User avatar
T4r4ntul4
Posts: 132
Joined: Wed May 21, 2014 1:57 pm
Location: Netherlands
Contact:

3MB traffic for one request?

Post by T4r4ntul4 »

I am actually not happy with the amount of files whats loading in. I have a simple web app, with a few buttons and a timer, but it generates 352 requests to the server for a total of 2.9 MB in 10,83 sec. (and i have not some cheap webhost)

Is it possible to load just the files it needs? Because i see its loading, for example, RadioButton.css, Calendar.css, and almost-every-gadget.js but iam not even using that in my app.

Is it possible to exclude that in the export?

I know theres a library map with all in it, but it would be better to only export the stuff it needs for that particurlarly web app. Or maybe better, keep the lib map, but only request the files its needs for the web app.

Whatever the outcome, the number files loaded needs to cut down alot.
poshu
Posts: 96
Joined: Mon Feb 24, 2014 11:46 pm

Re: 3MB traffic for one request?

Post by poshu »

I also noticed that on the french forum, and it really got me crazy.
Fred
Site Admin
Posts: 1506
Joined: Mon Feb 24, 2014 10:51 am

Re: 3MB traffic for one request?

Post by Fred »

It should be only an issue for the first launch, after all should be cached client-side. I know it's a lot of files, but that's the way DOJO works (tons of small files) which can get requested in parallel to accelerate the launch (!). That's the AMD stuff handled via RequireJS http://requirejs.org/
User avatar
T4r4ntul4
Posts: 132
Joined: Wed May 21, 2014 1:57 pm
Location: Netherlands
Contact:

Re: 3MB traffic for one request?

Post by T4r4ntul4 »

Just to get this straight:

So, if i make another GUI app, it will use the previous cached files in the browser?

Just for comparison: I made a app in javascript (Jquery) itself, and it uses only 1.46GB of traffic for the whole month, with 100k+ visits and 1 million+ hits.

Some math, if using SB: i have 35000 unique visitors (and still growing) on my site per month, it means that i can have 35000*3=105000 = 105GB of traffic??? just for a simple javascript GUI?

Thats alot of load not necessary for a site, i would think?
cederavic
Posts: 30
Joined: Tue Feb 25, 2014 6:49 am

Re: 3MB traffic for one request?

Post by cederavic »

Hello,
Your arguments are not reliable. Put a 3mb photo on your page and your traffic will but the same... only for one simple photo? yeah..
And you can't compare just Jquery against the tons of librairies used by SB.
You can't get over the first download of libraries (maybe we could compress them?). The real problem is the SB code translated in JS is in the same file as the SB libraries wich need a cache refresh if you make any change in your APP.
What i personnaly do to get over this, i server my html and js / css from a little web server written in python with Flask and simply put a token (based on timestamp) on spiderbasic.js (like: <script src="/static/js/spiderbasic.js?token=AEF486DFH87RV" />).
With that i just have to do a simple refresh on the browser (not the re-cache one) to have the new version of my app.

But yes, it would be nice if the code of our app is separated from other "static" JS. Also an option the regenerate the js (like what compile & run do) without opening the browser would be nice beacause it open n tabs in chrome for n compilation (i made a fake browser wich just copy de js file from %temp% to my server to get over that)
User avatar
T4r4ntul4
Posts: 132
Joined: Wed May 21, 2014 1:57 pm
Location: Netherlands
Contact:

Re: 3MB traffic for one request?

Post by T4r4ntul4 »

cederavic wrote: Your arguments are not reliable.
really? Why is that?

Iam not talking about pictures.

Iam talking about the big difference in export in MB between Jquery UI and SpiderBasic UI.
Iam not paying for more server load because i need to serve 3MB on files for an easy web app. While the same web app can be done in a few kb's in javascript jquery...
cederavic
Posts: 30
Joined: Tue Feb 25, 2014 6:49 am

Re: 3MB traffic for one request?

Post by cederavic »

Sorry if my answer seems aggressive, i did not mean to... I'm french and i don't always use the right words ;)

I know you are not talking about images, it was just to say SB use Dojo (wich is heavy yes) and your browser need to download it as to view a 3MB image your browser need to download its data. I don't think SB can run without Dojo, only fred can confirm that.
And you can't compare Jquery UI and Dojo. Jquery UI is very light in functionnalities compared to Dojo / Dijit, it's like comparing Unity with OpenGL.
User avatar
T4r4ntul4
Posts: 132
Joined: Wed May 21, 2014 1:57 pm
Location: Netherlands
Contact:

Re: 3MB traffic for one request?

Post by T4r4ntul4 »

I understand.

But if the web app is only using a few buttons, it loads alot of files what is not being used in the main app.

Its like loading 100 more pictures, that the user wont see anyway, just because its in the same album.
cederavic
Posts: 30
Joined: Tue Feb 25, 2014 6:49 am

Re: 3MB traffic for one request?

Post by cederavic »

Yes i agree on that. I don't know Dojo enough, maybe it's modular enough to load only what is actualy used in our code but i don't think so...
Maybe a CDN would be a great alternative too? If someone can provide it... With the trick of the token param, your program would take only maybe 100kb to download.

As you can see, loading the page with cached libraries (only script and css are reloaded) it took only 129kb :
Image
User avatar
T4r4ntul4
Posts: 132
Joined: Wed May 21, 2014 1:57 pm
Location: Netherlands
Contact:

Re: 3MB traffic for one request?

Post by T4r4ntul4 »

Token param?

I just tested, my browser is not caching anything.
Post Reply