RubyConf 2015

Mejora el rendimiento de tus sitios Rails sirviendo las imgenes adecuadas a cada usuario

Andy Croll  · 


Extracto de la transcripción automática del vídeo realizada por YouTube.

- Alright. Hello. - Right, so I'm going to talk to you today about images as a service. My name is Andy. My accent, I'm from the U. K. I work at a company called House Trip which is a bit like Airbnb except we have very enormous, enormous, enormous amount of money.

And it's sort of more for families and stuff like that. It's more for the holidays than it is people staying over. I run a very small consult team. I'm it. Where we do some Rail Mixins So we build apps. We make sure they are secure. Everybody is happy with them.

How they are running. I also run a little conference called Brighton Ruby on the south coast of the U. K. I'm running it next year on the 8th of July if any of you fancy a trip please, (background noise drowns out speaker) Splendid. So onto the talk. So, Images as a Service.

So this is something that came up at work. Often websites have images on them, as you are probably aware. But the thing that we need to think about is speed. So, there's a great article and who knows what this is? This is. . . That's correct. It's the save icon from Microsoft Office.

It used to be a physical object but you don't see that anymore particularly. This article from a guy called Pete Davis and he asks how many floppy disks a modern article on the Atlantic takes if you were to download it and put it on some floppy disks and pass it around to your friends.

So it was this article about dinasaurs, which is awesome, cause dinosaurs are awesome, as my toddlers tell me. So how big, if you had to take four pretty large images stick them in an rtf file with the text of the 6000 word article, how big would you say that is? Any guesses? Sorry? No actually only 400 KB and most of that's images.

So the text is about 37 KB worth of just as-k-ee text. Fits on a floppy disk with space to spare. If you were to download this over the internet on the Atlantic website, a modern publication, that's how big it is. Which we are on the extreme end here. A lot of that stuff is video ads and stuff.

When I visited with an ad blocker it was only about 3 MB. So that's sort of nuts. It's this many floppy disks. That was a productive half an hour on the internet by the way. Anybody recognize any of those? Still got them in their loft? My particular favorite Day of the Tentacle.

Absolute classic. There's a small coder of course. This article by Pete was published on Medium. Oh well. So at this point I'd like to apologize that despite my keynote foo it doesn't have like a doodle-ee-doo, doodle-ee-doo Wayne's World style take us back into history animation.

So this is what we have. Let me take you back to 2010. The impossible chasm of the Rails two to three migration. Ruby 1. 92. People were walking around with iPhone 4 S's like giant handed savages. In those five years, Marvel and Disney have built an entire cinematic universe.

Bigger, bigger, bigger! More characters per film, even larger giant ships crashing into even larger things, buildings, planets. As web developers and designers we've been doing the same thing. This is the growth of webpages from archive. org which takes a snapshot of the web as much as it possible can You can see here JavaScript has exploded over the last five years.

This is my frowning face. You can also see the rise of web fonts on the top there in the last couple years. However, even this ballooning JavaScript framework, fonty nonsense pails into insignificance next to images. A great deal of our pages are images. And as Ruby, this kind of sits in that halfway world between us and the front end guys.

Or if you are someone who does the front end as well it's your problem. Our pages got three and a half times bigger in five years. That's bonkers! The average page is 2 MB big. The average page. Thankfully, now that we live in the future this is no longer a problem.

And it's true to a certain point of view. According to the we have a regulator in the U. K. for broadband. And we've gone from 5 MB to just over 20 MB in those same five years. So, we're like, okay, pages are three and half times bigger and we've got 4 G now so everything is cool.

But obviously, high speeds all around, as we all know from our experience is not the whole story. Only a third of connections in the U. K. are high speed. And even amongst those at peak times only 10% of people are actually seeing the speed they are paying for.

This is why Netflix doesn't work in my house on a Friday. Smartphone connection have also increased from 20% of the market to 60%. So basically, as we've been making pages three and a half times bigger our networks have got slightly have got nearly the same faster.

But everything is a lot more shambolic in terms of network connections. Things are harder. Everyone's used a phone and gone, "Why isn't this god damn website loading?" So well done everybody. We've done a really brilliant job. So there are countless examples of speed being a good proxy for how customers work with your service.

Famously, Amazon are able to financially measure the difference in page load time and the size of the carts that people are paying for. I've personally seen similar things at HouseTrip. We make pages faster users get further down toward buying their holidays.

[ ... ]

Nota: se han omitido las otras 2.482 palabras de la transcripción completa para cumplir con las normas de «uso razonable» de YouTube.