So I have a heavy load of total ~64 split images in <TD> background from the one source.jpg(which size 70KB). I don't know how to fix that, it seems that something wrong in my code ,please help me to solve that. Code of split images works fine, but loads those images for about ~15seconds.
PHP Code:
// img.php file for displaying images
<?php
$in_filename = 'source.jpg';
I suspect it would be much more efficient to simply break that one image up into 64 separate image files, and just have your PHP code choose which one to use for each table cell, rather than doing 64 image manipulations on each page request. You could even use your existing PHP script as the basis of a script to do that, writing each image to a file instead of outputting it (using some naming convention to make it clear what each image is).
"Please give us a simple answer, so that we don't have to think, because if we think, we might find answers that don't fit the way we want the world to be."
~ Terry Pratchett in Nation
I'd suggest relying on CSS and using your background image like a Sprite. Let the browser do the work with (essentially) just one HTTP request for the image file with something like:
I apologize for any syntax errors. I got a bit lost in the quotation marks, but it should be close. And be sure to correct the background image URL now that it's inline and not embedded in your PHP script.
I'd suggest relying on CSS and using your background image like a Sprite. Let the browser do the work with (essentially) just one HTTP request for the image file with something like...
Good idea. I should have thought of that.
"Please give us a simple answer, so that we don't have to think, because if we think, we might find answers that don't fit the way we want the world to be."
~ Terry Pratchett in Nation
Bookmarks