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 7995973
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T14:34:48+00:00 2026-06-04T14:34:48+00:00

I have a JSON file referencing about 300 images used in an animation displayed

  • 0

I have a JSON file referencing about 300 images used in an animation displayed within my WordPress theme. In my header.php, I’m using the following jQuery to preload all images on DOM load.

function preload(images) {
  jQuery(images).each(function () {
    jQuery('<img />').attr('src',this).appendTo('body').css('display','none');
  });
}

jQuery(document).ready(function() {
  preload([
     "<?php bloginfo('template_directory'); ?>/library/images/img001.jpg",
     "<?php bloginfo('template_directory'); ?>/library/images/img002.jpg",
          //about 300 more...
  ]);
});

The issue is the images are 900x400px so it takes about 30 seconds for all 300 HTTP requests to go through. I’m thinking I could decrease load time if I load images with just one HTTP request. Is this possible? Thanks in advance.

  • 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-04T14:34:49+00:00Added an answer on June 4, 2026 at 2:34 pm

    Yes it is possible using sprites (No, not the soda). This is when images are packed into one big image.

    You can check out PHP’s GD library to generate the compiled image for you. Of course, compile once in advance, not every request or it will kill your server.

    Taking it to the extreme, you can send the images as a base64 string. That way, the string can be compressed on the server and decompressed on the client with an algorithm like LZW. To add to that, you can apply GZIP on transport.

    On the client side, you receive the image as one big image. If you encoded them in base64, you can use the data URI scheme to display the image using the base64 string.

    After all that, you can animate the images using the spriting technique, moving the images per frame.


    Additional tips:

    • compress the images using something like Adobe Fireworks:

      • Remove unused colors
      • reduce quality to an accepted degree
      • use a lightweight format like JPG
    • Split the animation into sections. This technique was used on Google’s mother’s day doodle, where the animation was split into parts and not per frame.

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

Sidebar

Related Questions

Right now I have a json file that im using to populate data within
I have the current JSON file: [{id:1,images:[{img_id:1},{img_id:2},{img_id:3}]}, [{id:2,images:[{img_id:1},{img_id:2},{img_id:3}]} How do I select the array
Possible Duplicate: PHP JSON decode - stdClass I have a JSON file with a
I have a json file (themes/snow/theme.json) { Name:'snow', Bgimage:'background.jpg', Width:600, Height:400, Itemrotation:'20,40', Text:{ Fontsize:12,
I have a question about the JSP. I have a JSON file in the
I have a json file and I assume that I do not know anyting
I have a json file exported from phpmyadmin, it looks like this(utf-8 file): [{user_email:
I have a JSON file which contains a pound symbol in it. This json
I have a JSON file which contains HTML content. I want to load it
I have a JSON file and want to parse value of variable second value

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.