Make site Load Faster - javascript

I have 8 MB in PNG files but the Problem is that i cant decompress them anymore i tried every png compressor. Maybe thre is also something in the code? Because the site takes damn forever to load. Is there a way i can compress the javascript or html or so?
Just take a look at the sourcecode and maybe its something there i can do to SPEED it up way faster?

There's like a zillion http-requests on your page. Try reducing the number of requests by using spritesheets and inlining css and javascript.
I see you are also using images for your menu? Try to use a font for that, with the #font-face directive. (this will also prevent the flash you are seeing, when you hover over the menu-items)
And try to use jpegs (as they allow much better compression for photographs in general) for the slideshow. Use a png for the frameborder to allow for transparency. This would also allow much more flexibility, since you don't have to manually add the frameborder in photoshop, should there be more photos to add to the sideshow.
There's like a ton of other stuff you could do to improve your speed. You should try to conform to some of the best practices in the modern web-industry.
Some useful resources for you:
Move the Web Forward
HTML5 Boilerplate

Did you use Photoshop to create your PNGs? If so, did you use File > Save for Web to save the images? That will reduce the size of your PNGs by a ton.

Try running the YSlow addon in Firefox.
YSlow analyses webpages and why they're slow based on Yahoo!'s rules for high performance web sites.
https://addons.mozilla.org/en-US/firefox/addon/yslow/

Things to do to make your page load faster:
Put all <scripts> at the end of the body - this
ensures that initial css and html is rendered before any JavaScripts
is loaded.
Convert you images to jpg. Since your gallery images has no
transparency, there is no need for png.
Resize your gallery images, they are bigger that than needed
Put smaller icons, menu items and other graphics into sprites
Use #font-face insead of servering text as images
Use css gradients for of gradients in images
Compress your JavaScript using tools like UglifyJs

Install page speed for Chrome and Firefox, which measures your speed and rates it and gives you suggestions on how to improve your page's speed.
http://code.google.com/speed/page-speed/
N.B: You must accept Experimental Extension Apis on Chrome and install Firebug for Firefox.
Enjoy!

Related

Flickity carousel images are not loaded completely

I am currently using the Flickity library to display corousels on my wordpress site.
The problem: When the site produkte is loaded the first time a lot of images get not loaded fully but only the first centimeter.
I am happy for any hints regarding this problem.
Kind regards
Lukas
1) Optimize images using Photoshop or below url and then upload in word press
or add image optimizer api in your word press website
https://kraken.io/web-interface
2) Minify CSS
3) Leverage browser caching for the cacheables
4) Minify HTML
cross check with https://gtmetrix.com/ too
hope this will help and boost website performance
Best luck
The most improvement you can get is to optimise the image size to make them as small as possible. Use this online service to reduce image sizes.
https://tinypng.com/
You can also install a plugin like Smush to optimise images automatically when they are uploaded.
https://wordpress.org/plugins/wp-smushit/
Also to reduce image sizes in the future you can install this plugin to ensure files of excessive size are resized.
https://wordpress.org/plugins/imsanity/
Once you have done this then you can use a caching plugin to speed up you site's overall performance.

How to load images faster?

I am working with processing.js for my project. When I use loadImage() or requestImage() in the setup, then use those images in draw(), it does not work at all. The image does not show. Even worse is that the program went gray(which means nothing is working)
I tried #pjs as well, but that didn't work. How can I make images load faster?
If you have a lot of images (especially small ones) use BASE64 encoded Data URI scheme to embed them into the HTML page. This will significantly reduce the number of round trips you need to make. You can use this tool to get the exact HTML or CSS from the image.
Bandwidth in most cases (even cellular) is pretty good, what creates more delays now is latency. See Google's recommendation on reducing the number of round trips.
You can also use more CSS sprites.
Does the web console say anything? This sounds like you're not preloading the image and your code executes before it's ready, but without an error it's not certain. Try adding this at the top of your code:
/* #pjs preload="example.jpg"; */
Documentation
If that doesn't work, have a look at the JS console in your browser and see what errors (if any) are printed. You could also include some debugging print statements in your code.

Javascript runs slowly in Safari / iPad2 after loading 200mb worth of new Images(). Why might this be?

Does anyone know why Javascript performance would be affected by the loading of lots of external JPG/PNG images into HTML5 Image() objects, totalling approx 200Mb-250Mb. Performance also seems to be affected by cache. Ie. if the cache is full(-ish) from previous browsing the performance on the current site is greatly reduced.
There are 2 says i can crudely solve it.
clear cache manually.
minimise browser, wait about 20 secs and re-open the browser after which time the iOS/browser has reclaimed the memory and runs the JS as it should.
I would have expected the iOS to reclaim required memory to run the current task, but it seems not. Another workaround is to load 200Mb of 'cache clearing' images into Image() objects, then remove these by setting the src = "". This does seem to help, but its not an elegant solution...
please help?
First and foremost read the excellent post on LinkedIn Engineering blog. Read it carefully and check if there are some optimizations that you can also try in your application. If you tried all of them and that still haven't solved your performance issues read on.
I assume that you have some image gallery or magazine-style content area on your page
How about having this image area in a separate iframe? What you could do then is this:
Have two iframes. Only one should be visible and active in time.
Load images into first iframe. Track the size of loaded images. If exact size tracking is hard
numberOfLoadedImages * averageImageSize
might be a pretty good aproximation.
As that number approaches some thresshold start preloading the currently visible content into second iframe.
Flip the visibility of iframes so the second one becomes active.
Clear the inner content of the first frame.
Repeat the whole procedure as necessary.
I don't know for sure if this would work for you but I hope that WebKit engine on iPad clears the memory of frames independently.
EDIT: It turned out you're writing a game.
If it's a game I assume that you want to have many game objects on the screen at the same time and you won't be able to simply unload some parts of them. Here are some suggestions for that case:
Don't use DOM for games: it's too memory-heavy. Fortunately, you're using canvas already.
Sprite your images. Image sprites not only help reducing the number of requests. They also let you reduce the number of Image objects and keep the per-file overhead lower. Read about using sprites for canvas animations on IE blog.
Optimize your images. There are several file size optimizers for images. SmushIt is one of them. Try it for your images. Pay attention to other techniques discussed in this great series by Stoyan Stefanov at YUI blog.
Try vector graphics. SVG is awesome and canvg can draw it on top of canvas.
Try simplifying your game world. Maybe some background objects don't need to be that detailed. Or maybe you can get away with fewer sprites for them. Or you can use image filters and masks for different objects of the same group. Like Dave Newton said iPad is a very constrained device and chances are you can get away with a relatively low-quality sprites.
These were all suggestions related to reduction of data you have to load. Some other suggestions that might work for you.
Preload images that you will need and unload images that you no longer need. If your game has "levels" or "missions" load sprites needed only for current one.
Try loading "popular" images first and download the remaining once in background. You can use separate <iframe> for that so your main game loop won't be interrupted by downloads. You can also use cross-frame messaging in order to coordinate your downloader frame.
You can store the very most popular images in localStorage, Application Cache and WebSQL. They can provide you with 5 mb of storage each. That's 15 megs of persistent cache for you. Note that you can use typed arrays for localStorage and WebSQL. Also keep in mind that Application Cache is quite hard to work with.
Try to package your game as a PhoneGap application. This way you can save your users from downloading a huge amount of data before playing the game. 200 megs as a single download just to open a page is way too much. Most people won't even bother to wait for that.
Other than that your initial suggestion to override cache with your images is actually valid. Just don't do it straight away. Explore the possibilities to reduce the download size for your game instead.
I managed to reduce the impact by setting all the images that aren't currently in the viewport to display:none. This was with background images though and I haven't tested over 100Mb of images, so can't say whether this truly helps. But definitely worth of trying.

Efficient jQuery or HTML5 image slider

I have a friend that is making a portfolio site. He has some high res images that he would like to display. There will be multiple projects on one page, and several images per project. Because of this, he would like to reduce load time as much as possible, and also conserve system memory usage. That being said, he's afraid that a conventional jQuery slider will eat up too much memory if it's called multiple times on the same page. Also, to load all of the images at initialization is just not an option as this would create long load times. Does anyone know of any image sliders, either jQuery or HTML5, or both that can help with this?
before spending time searching for a good jQuery slider...
...start from the basis:
start following general web design best practices like theese
keep your web page under 100 KB and load fast ? (the more is less the more is better)
use CDN (Content Delivery Network) to store HD images.
load HD images only on-demand, do not preload them.
use compressed, converted (avoid png) and resized images to fit the slider container.
do not scale images with CSS or inline CSS. (neither server side)
make use of the Lazy loading design pattern. (if as you say there are lots of images and the page is going to be very long)

Reducing image loading times?

I was wondering if there is any other ways to compress my images or any script that would load the page faster / or the the images behind the scenes?
The site is very interactive and using very high quality layers of images for the main layout. I have already saved for web devices in Photoshop and re-compressed using ImageOptim, some are jpeg but the majority are png24 to maintain transparancy, they are all set in CSS.
I have used jpegs and css sprites where i can but there is one in particular of a tree illustration streching the full site length, that is really slowing up the loading time, is there any I could compress these images further or code them differently that I missed?
Any help would be great thanks!
You said you are spriting. That is good.
You can also use tools such as PNGcrush which attempt to make files smaller by dropping things such as meta data.
You should also send far distant expiry headers and use a cache breaker on your images, to ensure the images won't be downloaded again if unnecessary.
In Photoshop, choose file-> save for web, you will be able to find the best compromise between size and quality.
Do you really need the transparency there? PNG transparency is unsupported on some browsers and makes the page processing intensive and slow even on high end computers, depending on image size and quantity of layers. If you can show something of your site maybe someone can give more hints about how to optimize it.
You can compress them on the fly with Apache if that's your web server. One of many available articles on the subject: http://www.samaxes.com/2009/01/more-on-compressing-and-caching-your-site-with-htaccess/

Categories