Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
Shaggar
Apr 26, 2006

Tiny Bug Child posted:

why is this dumb

aside from adding needless complexity to your code, if you ever update a single image on the sprite sheet all clients must essentially redownload all images instead of just the one image that was updated.

Adbot
ADBOT LOVES YOU

Jonny 290
May 5, 2005



[ASK] me about OS/2 Warp

Tiny Bug Child posted:

why is this dumb

hey random q, how much do you hate adblock plus
i havent gotten one porn popunder since i installed

Cold on a Cob
Feb 6, 2006

i've seen so much, i'm going blind
and i'm brain dead virtually

College Slice

Shaggar posted:

aside from adding needless complexity to your code, if you ever update a single image on the sprite sheet all clients must essentially redownload all images instead of just the one image that was updated.

i agree with you a lot of webdev stuff is dumb but i'm sure that an insurance company website has a pretty static set of images. to me it's not unlike batching your database calls and doing a little extra processing client side instead. assuming this wasn't all hand-coded it's probably pretty low on the totem pole of dumb things webdevs do

Socracheese
Oct 20, 2008

yeah, and if you change the image the servers might have to deal with several thousand requests for a 200kb file oh noooooo

an idiot web dev thing would be to have it not replace the old cached image. or storing credit card numbers in plaintext.

Shaggar
Apr 26, 2006
so you get a poor user experience from longer page loads, more complex code for the developer to manage, and higher bandwidth usage. i guess that is standard practice for web "development"

Cold on a Cob
Feb 6, 2006

i've seen so much, i'm going blind
and i'm brain dead virtually

College Slice
don't get me wrong i'm not saying it's smart, seems like micro-optimization wankery that should be reserved for really high traffic sites, if it does indeed work as advertised

just there's lots worse things web devs do all the time

echinopsis
Apr 13, 2004

by Fluffdaddy
i enjoyed coding once but then i realised it was an elite club for sociopaths and cat children and i just didnt feel ok about it after

Socracheese
Oct 20, 2008

i hate coding, people, the earth, being alive, etc

echinopsis
Apr 13, 2004

by Fluffdaddy

Socracheese posted:

i hate coding, people, the earth, being alive, etc

i dont hate the earth, the earth is 1 cool motherfucker

the rest though

Sapozhnik
Jan 2, 2005

Nap Ghost
I do the PNG spritesheet thing too but it's loving huge so I probably need to find alternatives

OTOH once it's fully loaded people can put stuff together out of clips from that spritesheet and you can see live previews flash past as you move the mouse across the options in the dropdown and it srsly ownz

echinopsis
Apr 13, 2004

by Fluffdaddy
me too

MononcQc
May 29, 2007

Shaggar posted:

aside from adding needless complexity to your code, if you ever update a single image on the sprite sheet all clients must essentially redownload all images instead of just the one image that was updated.


Your regular browser won't allow that many concurrent connections per host. IE7 and other older browsers allow 2, IE8 allows 6, Chrome goes for 6, FF for 8 and used to be 4, etc.

Over each of these, you may then attempt to pipeline requests. Opera fully supports proper pipelining, Chrome does it over HTTP only, IE8 doesn't make use of it due to potential head-of-line blocking, and FF disables it by default.

This means that in general, if your images are on a single domain, you will only download from 2 to 8 of them at a time. The rest will be queued up, until the connections are closed, renegotiated, and finally downloaded to slowly appear when possible.

Assuming you still allow pipelining though that requires you to pass around cookies and HTTP headers (including cache info) every time.

In the general case, you should assume there's no pipelining. Given this, you should shard your images across many subdomains of a CDN and evenly round-robin (or randomly) go through these to allow maybe 16-32 connections instead of 2-8, to pull random numbers. This will drastically improve perceived speed by the client.

Then you should ideally sprite small images together, especially icons given HTTP headers, cookies, and poo poo, may end up weighing nearly as much as the image. Huge overhead for no reason. By spriting them, you use one connection, one transmission of client-side data only.

It's a bit useless to make sprites out of huge images given how little that saves compared to sharding domains. You may find out it helps gzipping them and cache in general, though, but it's very possible it makes things slower than if you sharded domains in the first place.

To add more, if you take your standard web site and call it with some timers, you'll find out a huge part of the load time you get comes from assets being queued up in the background -- a lot more than whatever language is used by the server, and most of the time, the database chosen. Optimizing how static assets are downloaded is likely a better time investment than most server-side optimization you could decide to make.

</sperg>

MononcQc fucked around with this message at 22:05 on Nov 26, 2012

Cocoa Crispies
Jul 20, 2001

Vehicular Manslaughter!

Pillbug

MononcQc posted:

Your regular browser won't allow that many concurrent connections per host. IE7 and other older browsers allow 2, IE8 allows 6, Chrome goes for 6, FF for 8 and used to be 4, etc.

Over each of these, you may then attempt to pipeline requests. Opera fully supports proper pipelining, Chrome does it over HTTP only, IE8 doesn't make use of it due to potential head-of-line blocking, and FF disables it by default.

This means that in general, if your images are on a single domain, you will only download from 2 to 8 of them at a time. The rest will be queued up, until the connections are closed, renegotiated, and finally downloaded to slowly appear when possible.

Assuming you still allow pipelining though that requires you to pass around cookies and HTTP headers (including cache info) every time.

In the general case, you should assume there's no pipelining. Given this, you should shard your images across many subdomains of a CDN and evenly round-robin (or randomly) go through these to allow maybe 16-32 connections instead of 2-8, to pull random numbers. This will drastically improve perceived speed by the client.

Then you should ideally sprite small images together, especially icons given HTTP headers, cookies, and poo poo, may end up weighing nearly as much as the image. Huge overhead for no reason. By spriting them, you use one connection, one transmission of client-side data only.

It's a bit useless to make sprites out of huge images given how little that saves compared to sharding domains. You may find out it helps gzipping them and cache in general, though, but it's very possible it makes things slower than if you sharded domains in the first place.

To add more, if you take your standard web site and call it with some timers, you'll find out a huge part of the load time you get comes from assets being queued up in the background -- a lot more than whatever language is used by the server, and most of the time, the database chosen. Optimizing how static assets are downloaded is likely a better time investment than most server-side optimization you could decide to make.

</sperg>

Shaggar
Apr 26, 2006

MononcQc posted:

Your regular browser won't allow that many concurrent connections per host. IE7 and other older browsers allow 2, IE8 allows 6, Chrome goes for 6, FF for 8 and used to be 4, etc.

Over each of these, you may then attempt to pipeline requests. Opera fully supports proper pipelining, Chrome does it over HTTP only, IE8 doesn't make use of it due to potential head-of-line blocking, and FF disables it by default.

This means that in general, if your images are on a single domain, you will only download from 2 to 8 of them at a time. The rest will be queued up, until the connections are closed, renegotiated, and finally downloaded to slowly appear when possible.

Assuming you still allow pipelining though that requires you to pass around cookies and HTTP headers (including cache info) every time.

In the general case, you should assume there's no pipelining. Given this, you should shard your images across many subdomains of a CDN and evenly round-robin (or randomly) go through these to allow maybe 16-32 connections instead of 2-8, to pull random numbers. This will drastically improve perceived speed by the client.

Then you should ideally sprite small images together, especially icons given HTTP headers, cookies, and poo poo, may end up weighing nearly as much as the image. Huge overhead for no reason. By spriting them, you use one connection, one transmission of client-side data only.

It's a bit useless to make sprites out of huge images given how little that saves compared to sharding domains. You may find out it helps gzipping them and cache in general, though, but it's very possible it makes things slower than if you sharded domains in the first place.

To add more, if you take your standard web site and call it with some timers, you'll find out a huge part of the load time you get comes from assets being queued up in the background -- a lot more than whatever language is used by the server, and most of the time, the database chosen. Optimizing how static assets are downloaded is likely a better time investment than most server-side optimization you could decide to make.

</sperg>

forever owned by bad web specs. cant wait till web "developers" fashion a solution to the connection limit problem by using unlimited websocket connections.

MononcQc
May 29, 2007

Shaggar posted:

forever owned by bad web specs. cant wait till web "developers" fashion a solution to the connection limit problem by using unlimited websocket connections.

Bad web specs are a part of it. I have no proof but I'm pretty sure an important part of it is to make it harder for browsers to inadvertently DDoS servers that have many images to the same server by spamming them with dozens or hundreds of fresh connections.

Tiny Bug Child
Sep 11, 2004

Avoid Symmetry, Allow Complexity, Introduce Terror

Shaggar posted:

aside from adding needless complexity to your code, if you ever update a single image on the sprite sheet all clients must essentially redownload all images instead of just the one image that was updated.

lol shaggar doesn't understand web development

Tiny Bug Child
Sep 11, 2004

Avoid Symmetry, Allow Complexity, Introduce Terror

Jonny 290 posted:

hey random q, how much do you hate adblock plus
i havent gotten one porn popunder since i installed

i don't hate it at all, anyone who installs adblock plus is not going to pay for porn anyway

rotor
Jun 11, 2001

classic case of pineapple derangement syndrome

Shaggar posted:

forever owned by bad web specs.

the limit on concurrent connections is not in any spec shaggar come on, you could at least have gone for the beautiful webs angle or something

duTrieux.
Oct 9, 2003

it's the monday after a holiday, give him a few days to spin it back up

Shaggar
Apr 26, 2006

MononcQc posted:

Bad web specs are a part of it. I have no proof but I'm pretty sure a more important part of it is to make it harder for browsers to inadvertently DDoS servers that have many images to the same server by spamming them with dozens or hundreds of fresh connections.

i dont see how an arbitrary spec protects against that. the browsers most likely to have internal bugs that cause it to do too many requests are either gonna ignore the spec anyway or allow the user to choose to ignore it (ex: failurefox). and any web "developer" who creates "code" that generates too many requests or a request loop deserves to have their servers flooded. they'll be real quick to fix it. as opposed to it being hidden behind piles of slow from their other code when connections are limited.

since servers have 0 control over browser clients everyone has to operate in good faith. since this is the case why not suggest the connection limit to the client in another header or something.

its kind of a hack, but if you really wanted to fix it you'd overhaul the http spec because its way way way out of date.

rotor
Jun 11, 2001

classic case of pineapple derangement syndrome
just base64 all the images and inline them in the html imo

Wheany
Mar 17, 2006

Spinyahahahahahahahahahahahaha!

Doctor Rope
i agree with shaggar.

instead of sprite sheets, web sites should use canvases and procedural generation

rotor
Jun 11, 2001

classic case of pineapple derangement syndrome

Wheany posted:

i agree with shaggar.

instead of sprite sheets, web sites should use canvases and procedural generation

canvas is sorta cool but svg is better because vectors.

MononcQc
May 29, 2007

Shaggar posted:

i dont see how an arbitrary spec protects against that. the browsers most likely to have internal bugs that cause it to do too many requests are either gonna ignore the spec anyway or allow the user to choose to ignore it (ex: failurefox). and any web "developer" who creates "code" that generates too many requests or a request loop deserves to have their servers flooded. they'll be real quick to fix it. as opposed to it being hidden behind piles of slow from their other code when connections are limited.

since servers have 0 control over browser clients everyone has to operate in good faith. since this is the case why not suggest the connection limit to the client in another header or something.

its kind of a hack, but if you really wanted to fix it you'd overhaul the http spec because its way way way out of date.

There's no proper spec regarding how many connections you can have. You may call it a bad spec or not due to omission if you want. Part of it is also the lack of a 'session' concept, which can be both positive and negative, depending of the kind of content you serve. Such sessions could impose limits on concurrent connections (for example, BOSH limits to 1 connection per session by design).

The original HTTP specs had more to do about documents and 'resources' as a broader concept than your-fun-hip-bay-area-web-app-of-the-month that uses a browser like a thin client, so I'd rather call it a bad choice of protocol for the app, rather than a badly designed protocol.

Servers do not necessarily operate in good faith. If you write a web app that trusts anybody you likely have a security shithole.

The connection limit is a tricky thing in the first place, in any case. Proper pipelining would help a good bit to reduce how many connections you want for small content, but that's not the end of it anyway.

A high connection limit is alright when they don't last long and can be cleared fast, but when they're incredibly slow, it becomes unclear whether you're dealing with a slow client, someone with high latency (say, satellite), or a plain old Slowloris-like DDoS attack.

rotor
Jun 11, 2001

classic case of pineapple derangement syndrome
http is designed for a particular thing but somehow we've decided to tunnel all traffic through it and it's terrible.

Wheany
Mar 17, 2006

Spinyahahahahahahahahahahahaha!

Doctor Rope
also you can just generate your image data, base64-encode it and set it as a data:url to an image tag.

come on people, this is not rocket science.

Max Facetime
Apr 18, 2009


rotor posted:

just base64 all the images and inline them in the html imo

yeah this is pretty dumb thing already

but I think I can do better than that

how about sending uncompressed binary data encoded as a PNG image using its inbuilt compression to avoid having to configure your web server to compress http responses:



but if that doesn't have you shaking your head already, it doesn't have to stop there, this technique could be taken further

you could encode all your static .html, .js, .css files in with the sprite sheet, then you could dump your user-viewable database in binary, serve it with a second http get and run javascript queries against that, no further network traffic required!

but wait, PNG is an extendable format where any unknown chunks are supposed to be ignored by browsers, so what if we could include java applets, Silverlight w/e things, windows 8 metro apps, etc in that initial static file bundle that's going to end up cached everywhere, we could do a real optimized cross-platform software bundle

duTrieux.
Oct 9, 2003

gently caress you

Jonny 290
May 5, 2005



[ASK] me about OS/2 Warp

duTrieux. posted:

gently caress you

MononcQc
May 29, 2007

Win8 Hetro Experie posted:

yeah this is pretty dumb thing already

but I think I can do better than that

meet gifsockets, allowing you to continuously stream data through animated GIFs.

Nomnom Cookie
Aug 30, 2009



MononcQc posted:

meet gifsockets, allowing you to continuously stream data through animated GIFs.
Gonna use this next time my boss makes me do a web

gently caress webs

Cold on a Cob
Feb 6, 2006

i've seen so much, i'm going blind
and i'm brain dead virtually

College Slice

MononcQc posted:

meet gifsockets, allowing you to continuously stream data through animated GIFs.

lol so someone gonna use this to cause people to go over on their mobile data plans?

Cold on a Cob
Feb 6, 2006

i've seen so much, i'm going blind
and i'm brain dead virtually

College Slice

quote:

Since a gif image doesn't specify how many frames it has, once the browser opens it, it will keep waiting for new frames until you send the bits indicating that there's no more image to fetch.

i'm dying here lmbo

rotor
Jun 11, 2001

classic case of pineapple derangement syndrome

Cold on a Cob posted:

lol so someone gonna use this to cause people to go over on their mobile data plans?

we've already got a bunch of ways to do this, even apple did it.

JawnV6
Jul 4, 2004

So hot ...

duTrieux. posted:

gently caress you

jooky
Jan 15, 2003

MononcQc posted:

meet gifsockets, allowing you to continuously stream data through animated GIFs.

huh now i know why chrome sucks at gifs. thanks

Zombywuf
Mar 29, 2008

Shaggar posted:

forever owned by bad web specs. cant wait till web "developers" fashion a solution to the connection limit problem by using unlimited websocket connections.

I can tell how little you understand web development by the way that you think you're talking about the future here.

Shaggar
Apr 26, 2006
web "development" is bad. thats all there is to it.

Shaggar
Apr 26, 2006
lol if you unironically think web sockets are a good idea.

Adbot
ADBOT LOVES YOU

echinopsis
Apr 13, 2004

by Fluffdaddy
are they anything like "socks", that you put on your feet? I cant see how they relate

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply