1

Currently I'm working on a huge project that involves thousands of lines of CSS, JavaScript and a bunch of images. Minifying CSS style sheets and JavaScript files with added compression helps a lot, but it still isn't perfect.

For preloading images in CSS stylesheets, I have found a bunch of plugins, including here on stackoverflow. However, since there are a lot of jQuery and JavaScript libraries - preloading just CSS images in stylesheets doesn't help my cause at all. Is there a way to preload the CSS files themselves, along with images found in those files, and JavaScript libraries in one go? I would use such a feature after confirming user credentials, and after preloading the required content redirecting users to the inner content.

Also: I could easily provide an array of files needed for preloading, without having JavaScript to parse any files.

2
  • if you are usingany server side framework, then you can apply staticContent cache. for more info iis.net/configreference/system.webserver/staticcontent/… Commented Apr 18, 2013 at 12:24
  • A big part of the libraries are created on the fly with Java, and almost 80% of them change after a user session has ended. It's a very stupid system, and I have the honors of trying to make everything work :/ Commented Apr 18, 2013 at 12:35

1 Answer 1

1

You might take a look at using the appcache to cache resources. That will speed things up for modern browsers, though won't help you with older ones. There's a good tutorial here.

I'm guessing most of your page size comes from images. You might try spriting your images and using gzip, which is supported by even older browsers (IE 5.5+ for example).

Sign up to request clarification or add additional context in comments.

4 Comments

I'll be sure to try this out. However there are a bunch of clients who won't upgrade their browsers, and I'm stuck with almost a 10mb page load :/
Not only images, there are a bunch of proprietary JavaScript libraries I HAVE to use. The system is insanely old, the only addition I made was adding jQuery to ease the amount of new code written for the basic UI. The servers where moved from local to cloud, and the loading times are insane.. That's why I'd like to preload everything during the login process, it would be more clear than having a broken HTML page while everything loads..
are you sure that downloading the files is the bottleneck? With all that CSS and javascript, the page will probably take a long time to render
Yes, because the internet connection is really slow, thus it takes up to a minute to load everything. The system was local before the move to cloud, and the load on the browsers wasn't that significant.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.