Hi,
I'm not sure I'm posting in the right place now, but then maybe someone can move the thread.
I have a pretty heavy loaded homepage with large images that take up the entire page. Although I have reduced the quality of the pictures the front page take some time to load, especially on mobile devices.
As it is now the menu loads when all the images have been loaded, so the first step would be that the menu loads first. How can I do that?
I'm not sure if I should post all the code here to show how I've done, it gone be a lot. But if you need some code, just let me know and I will post it.
If you f.ex check the network request you have on the homepage you can see its running 36 http request that are in total 8.6mb.
Thats way over the top for mobile phones (and desktop if you think about it). I would try to get it to max 1mb and under 30 requests.
Most of the images are loaded right away but are then just shown randomly with a timer, I would think that probably 1% of your visitors will wait on the homepage and look at all the images.
If you want this function I would load ony 1 image first and then use somekind of an lazyload to load the others.
Hope this helps you, I would try to go deeper on this but at the moment I dont have time, will take a look at this thread when I can.
thanks it help a lot. I know that my pictures are too big and too many. Reduce the number of images on the first page, to begin with. Then I keep on googling and trying to find how to solve the problem of load first image, and then load the rest of the pictures. But I have not found a suitable solution yet.
But I will continue and see if I can find some solution to this.
I added a new field in umbraco where I upload pictures with max width 400px and I only have 5 images there, which I load when the width is less than 400px. However, I probably have reduced the quality of the images a bit too much, but what else do you think about this solution?
<script type="text/javascript">
if (window.matchMedia("(max-width: 460px)").matches)
{
@{
var mediaID5 = Model.Content.GetProperty("mobileimages").Value.ToString().Split(',');
@:jQuery(function($){
@:$.supersized({
@:slideshow : 1, // Slideshow on/off
@:autoplay : 1, // Slideshow starts playing automatically
@:start_slide : 0, // Start slide (0 is random)
@:slide_interval : 3000, // Length between transitions
@:fit_always :0,
@: slides: [
foreach (var mediaID in mediaID5){
var media = umbraco.uQuery.GetMedia(mediaID);
@:{ image: '@media.GetImageUrl()'},
}
@:],
@:});
@:});
}
}
else
@{
var mediaID1 = Model.Content.GetProperty("images").Value.ToString().Split(',');
@:jQuery(function($){
@:$.supersized({
@:slideshow : 1, // Slideshow on/off
@:autoplay : 1, // Slideshow starts playing automatically
@:start_slide : 0, // Start slide (0 is random)
@:slide_interval : 3000, // Length between transitions
@:fit_always :0,
@: slides: [
foreach (var mediaID in mediaID1){
var media = umbraco.uQuery.GetMedia(mediaID);
@:{ image: '@media.GetImageUrl()'},
}
@:],
@:});
@:});
}
Faster website
Hi, I'm not sure I'm posting in the right place now, but then maybe someone can move the thread.
I have a pretty heavy loaded homepage with large images that take up the entire page. Although I have reduced the quality of the pictures the front page take some time to load, especially on mobile devices.
As it is now the menu loads when all the images have been loaded, so the first step would be that the menu loads first. How can I do that?
I'm not sure if I should post all the code here to show how I've done, it gone be a lot. But if you need some code, just let me know and I will post it.
You can find my website here: www.jonasfotograf.se
Thanks, Jonas
(Sorry for my bad English.)
Hi Jonas,
If you f.ex check the network request you have on the homepage you can see its running 36 http request that are in total 8.6mb.
Thats way over the top for mobile phones (and desktop if you think about it). I would try to get it to max 1mb and under 30 requests.
Most of the images are loaded right away but are then just shown randomly with a timer, I would think that probably 1% of your visitors will wait on the homepage and look at all the images.
If you want this function I would load ony 1 image first and then use somekind of an lazyload to load the others.
Hope this helps you, I would try to go deeper on this but at the moment I dont have time, will take a look at this thread when I can.
Best regards
Gardar
Hi Gardar,
thanks it help a lot. I know that my pictures are too big and too many. Reduce the number of images on the first page, to begin with. Then I keep on googling and trying to find how to solve the problem of load first image, and then load the rest of the pictures. But I have not found a suitable solution yet.
But I will continue and see if I can find some solution to this.
Thanks,
Jonas
I added a new field in umbraco where I upload pictures with max width 400px and I only have 5 images there, which I load when the width is less than 400px. However, I probably have reduced the quality of the images a bit too much, but what else do you think about this solution?
You could run all the images through an image file compression tool to reduce the file size of your images further.
FileOptimizer works well
http://nikkhokkho.sourceforge.net/static.php?page=FileOptimizer
Thanks John, I will look into it.
is working on a reply...