What is this method of display images called? - html

On Google Images, some images are loaded like this:
data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wCEAAkGBhQSEBQUEhQVFRQWFBQXFRYVFRQQFhIUFBQXFRYWFxQYHCYfGBkjGRcUHy8gIycpLCwsFR4xNTAqNSYrLCkBCQoKDgwOGg8PGi8kHyQyLCwsLCwtLiwsLC0sKSwsLCwsKSwsLCosLCwpLCwsLCksLCwsLCwsLCwsLCwsKSwsLP/AABEIAOQA2AMBIgACEQEDEQH/xAAcAAEAAgMBAQEAAAAAAAAAAAAABgcBBAUDCAL/xABEEAABAwEFAwgHBQYGAwEAAAABAAIDEQQFEiExBkFRBxMiYXGBkaEjMlJyscHRFCRCYpJzgqKywvAWM0Nj4fFTZMMV/8QAGwEBAAIDAQEAAAAAAAAAAAAAAAQFAgMGAQf/xAA0EQACAgIABAQEAwcFAAAAAAAAAQIDBBEFEiExEyJBUQYyccGRsfAUI0JhoeHxJDNSYtH/2gAMAwEAAhEDEQA/ALxREQBYWVEdrNrnxSfZ7MA6YtxOc7NsQOlRvceCwnJRW2bqKJ3z5IdyW1RUtLtbeEMv+eXmtcOEEHqDaZKx9jtqftkXSbglb6zd3CoWuF8ZvROy+FXYsFNtNfyJEiLkXjexDiyPUanWh6gteXl1YtfiWPoV0IOb0jroFGY71laak16iB8l37FahI0OHeOBUXC4rRmPlh0fszOyiVfVmwiIrU0hERAEREAREQBERAEWKrh3nttY4H4JJm4t4aC8jtwg0XjaRjKSitt6O6i0brvuG0txQSNeN9DmO0ahbtV6eppraMoiIehERAEREBgqnNpbcYLztRcDVxaWn8pY2nz8FcirXlWuyj4ZwMnVjeevMt+YUbJW4b9i64JZGOTyS/iWvv9ivor8cLRzh4lT7k1tZktUjtxa4nd7IVZTspIrO5Hoa88/gA0d5J+Si1Lzo6njUYRxZSS9Eiy1FbQ6kj/ePxUqUbvyHDLX2hXv0P99arPiSpzx4yXo/zOIw2ufRqxS0Xa2f9R3vfJcBqklxx0iHWSfl8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lXPRSdZoimwgoR5Uc5ddK6bnLuzCLKLM1BERAEREAREQBERAFhZRAVxymAGVoI/AKdeZUIitTmeo4jvP1V6W+7Ipm4ZWNePzCtOw6juUbtPJnZHVLedZ7r6gdzgVFnS29ohX0Tk+aLKltk75D0jXuB8zmvOzQ4TXXqJNPIhWe/kli3TyjtbGf6Qsx8k8Q1nlPY2NvyKx8KZC/Y7W9/cgQlJAGVBSlBw4nUlTXk5Pp3U/wDGa/qbT5+C7Vk5ObIzUSP955p4NopFYrvjhbhiY1g4NFK9vFZQpae2S6cecZc0me6LKKUTwiIgCIiAIiIAiIgCIiAIiIAiIgCIiAIiIAiIgCwiIAiIh4FlEQ9CIiA//9k=
What is this called? I want to find some more information about it (eg. how well is it supported? Is it faster than traditional images?).

This is the Data URI schema, defined in RFC 2397.
In this specific case the image is base64 encoded and embedded in the page/css.
Doing this (Base64 encoding) increases the size of the data (by about 30%), but the data URI avoids an additional request to the server which in many cases would cause the complete page to load faster.

It's called Base64 encoding, or encoding Data URIs.
It's processed at the same speed as regular images, but it doesn't require an extra HTTP request, so it will result in a faster webpage load, but a (slightly) heavier HTML/CSS file.

That's the data URI scheme, see RFC 2397 as well.

Related

How and where do you encode the header and charset parameters for CSV files?

The CSV spec (RFC 4180) identifies header and charset parameters, but it strangely doesn't specify where they go, or how they're encoded. For header it says:
The "header" parameter indicates the presence or absence of the header
line. Valid values are "present" or "absent".
But where does this go in a CSV file or stream? And where does charset go?
See section 3 of the spec for the parameters bit. The whole doc is only a couple of pages of actual content, as we might expect for a CSV spec, but it leaves out critical details. Note that I'm not asking about a web server-to-browser scenario where there'd be HTTP header fields for MIME type or charset, but rather the general case of CSV files and streams.
Confirming that there really is nowhere in a CSV data file to put those metadata fields, either as a file or as a stream.
Those two fields are - as you mentioned - only for cases where a CSV file is being exchanged via a MIME aware protocol, such as HTTP.
Other formats have found different ways around the problem. E.g. JSON must be encoded using UTF-8. XML has an encoding in the prolog.

Do browsers cache JSON

I want serve a JSON from a storage bucket. The JSON data will be updated periodically, but the URL will remain the same (I don't want to have to redeploy my site with an updated URL every time the JSON is updated). But I know that if this was CSS I would have problems with the browser caching the file and not fetching the updated data. Do browsers cache JSON like they do CSS?
Yes. Caching related headers and (how they are handled) work for all HTTP resources. The file type isn't relevant.

Can URL #anchor contain binary data?

I'm trying to encode web pages state in #anchor. Right now I am base64 encoding a JSON string, but it sometimes gets too long (10K+). Apparently I hit some kind of URL length limitation and it just doesn't work right (it gets cut off and JSON data structure can't be reconstructed).
I talked with some of my buddies and they said try to bzip or gzip it. I tried that, but now my #anchor is binary data.
I haven't been able to decode it properly, and I'm not sure if it even got sent correctly as part of URL.
Does anyone know how to add binary data in #anchor, if it's a good idea, or how to come up with an alternative working solution for my problem?
I would not bother with all of this.
Use Local Storage for your large data, and send a reference through your anchor to the data.

Does data URL only accept binaries or base 64 for Powerpoint?

There is a trick for creating files in the client using data uri. For example, to create a MS powerpoint you can do something like
Test File 3
Is the only data that can be specified in the in the URL is the base64 or the binary representation of the file? Is it possible to express any other representation of the file?
Both Base64-encoded and plain content is supported. For example, you can use HTML too:
Click Here!
You should see a "It works!" after clicking the link. (Works in Firefox and Chrome, for compatibility table, see http://caniuse.com/datauri)
To generate plain content that can be filled into Data URI, you need to use something like encodeURIComponent in JavaScript or rawurlencode in PHP.
The syntax of the data protocol is as follows:
data:[sMediaType;][sBase64Encoding;],sResourceData
(https://msdn.microsoft.com/library/cc848897)
As you can see, there isn't any option for a non-base64 encoding.

Ruby encoding question

I'm saving scraped data to a web app, and here's a sample param:
400\xB0F.
This is the 'degree' character from a website, but when I put that into my model I get the dreaded invalid byte sequence in UTF-8 error.
Since it's coming from the web I thought I might try some client side encoding, so javascript turns that into: 400%B0F. This can at least get saved by ActiveRecord with no issue, but Rails seems to be escaping it again on the way out so those entities aren't decoded by the browser, so my show method shows the entire encoded string.
Where should I be cleaning up my input data, and what methods might be the best to use for unpredictable input?
Thanks!
Years ago I had, and solved, this very same problem in builder. Take a look at the to_xs method: http://builder.rubyforge.org/classes/String.html#M000007
You can require builder, and use it directly (you might want to pass false to escaping or you will get entity escaped output). Either that, or simply steal and adapt the source.
Update: here is the original, standalone, library:
http://intertwingly.net/stories/2005/09/28/xchar.rb
Perhaps you can use a binary form (like for upload file) with enctype="multipart/form-data" in form tag. Like this, you can use this data as a binary data ?
It's depends perhaps of waht you do with this data.
URI.unescape was the trick, after I encoded it client-side