Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8135579
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T10:28:09+00:00 2026-06-06T10:28:09+00:00

So here is my plan for fast web page downloading… Place all images into

  • 0

So here is my plan for fast web page downloading…

  1. Place all images into a single png-24 image sprite.
  2. Encode that image as base64 and include it in the webpage HTML code.
  3. Duplicate the SRC of the original image sprite and re-use it for the logo, share buttons, other images, etc..

The only problem I can foresee is the duplication of the base64 encoded image source.

Can I readily extract the image source with jQuery and just re-insert it into all of my blank images (the images that need the sprite to be created)?

EDIT: Some people are mentioning base64 images are not cached, but wouldn’t my entire webpage (containing the base64 images) be cached if I told it to be?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T10:28:11+00:00Added an answer on June 6, 2026 at 10:28 am

    That is a common technique with CSS icons / reusable images.

    You can get the image src using $(element).attr('src');.

    However, I don’t see the advantage of encoding the image binary (I’m assuming you meant the image file itself) to base64 to include with the HTML markup. You may be over-thinking this a bit.

    I don’t think you can “save” bytes by re-encoding the image data into base 64, primarily because base 64 is a narrower character set than the encoding used in the original data (think binary 111 = decimal 7), so I expect a larger output actually. (But that’s just me theorycrafting, so correct me if I’m wrong.)

    However, if you do manage, for example, to re-encode to at most an equal size of markup, then you’re not making any headway with “faster downloading”. You’re still downloading the same amount of data. Most probably more.

    If you do manage a smaller payload, is the performance hit of encoding / re-encoding worth it? Not to mention the cross-browser compatibility.

    A better technique would be to package the images into a single image file (which is the spirit of your exercise), and just let the browser download that as normal. Once one copy of an image is downloaded, as long as its cached by the browser, it won’t download it anymore.

    EDIT

    To answer your edit regarding caching of the web pages, yes, your web pages will be cached. So will your base-64 encoded images. But since your images are effectively part of the HTML markup, they’re going to be cached with the HTML pages.

    e.g. If I download foo.html (which includes my encoded sprite file), I’m definitely going to get my markup as normal. That page is cached.

    Now, I download bar.html (which uses my sprite file too). I expect that your image won’t be cache-accessible from bar.html, because as far as the browser is concerned, that image is part of the HTML markup of foo.html. It probably won’t even realize that there’s an image wedged in there.

    The way caching works (as best I can understand it) is URL matching. That’s the reason why if I download facepalm.jpg in one page, and request facepalm.jpg again in another, the browser recognizes that I’ve already downloaded it, so it doesn’t.

    With your encoding plan, I’m not going to be requesting foo.html (or part of it) from bar.html, so I expect that your image caching won’t work as you expect it to in your question.

    If I visit foo.html again though, I’d get all benefits of caching for that page, as I’ve “downloaded that before”.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Here's the view: @if (stream.StreamSourceId == 1) { <img class=source src=@Url.Content(~/Public/assets/images/own3dlogo.png) alt= /> }
Here's the battle plan: User logs into website. User clicks the Play button and
Here's an odd one, for me at least. I'm reading an image into a
Here is my plan, and goals: Overall Goals: Security with a certain amount of
Here is my dial plan in asterisk: [main-context] exten => s,1,Gosub(subcontext,s,1) exten => s,n,NoOp(End
Do any browsers currently support or plan to support fast array math operations, similar
Here's my explain plan: SELECT STATEMENT, GOAL = ALL_ROWS 244492 4525870 235345240 SORT ORDER
OK So here's the plan. The XML I'm getting data from allows non-numeric text
Right, I haven't got to coding any of this yet but here's my plan:
I am planning to make a responsive+mobile first web design. So here is my

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.