/    Sign up×
Community /Pin to ProfileBookmark

Website loads very slow

Hey,
i have created a onepager with a gallery (a bootstrap 4 modal (as popup) with a carousel in it). Now the problem is that the carousel needs all pictures to display in the sourcecode of my site. I do that with a php function which creates for all images in a folder an image object at the website but this causes that the website have to load all pictures (~120mb) at the opening -> it loads very slow. Is there a way to load or create the image object only when the gallery (modal) gets opened or when it gets visible?

Thanks in advance!

to post a comment
Full-stack DeveloperHTML

10 Comments(s)

Copy linkTweet thisAlerts:
@rootJul 13.2018 — You have not provided the code you are using, if you are having loading issues, then maybe your loop and conditional testing isn't working and if you are not using JavaScript and a library instead, then thats where the problem is.
Copy linkTweet thisAlerts:
@SempervivumJul 13.2018 — the carousel needs all pictures to display in the sourcecode of my site.[/quote]
Is there a way to load or create the image object only when the gallery (modal) gets opened or when it gets visible?[/quote]
Yes, there is: Swiper has a lazy-load mode where the image is loaded only when it comes into view.

http://idangero.us/swiper/demos/

Search for lazy loading.

(don't worry about the images not loading, this is not an issue of the script but of the server providing the images (lorempixel))

However this is not perfect as the image is loaded only when it comes into view. A better solution would be loading an image in advance when it gets the neighbour of the visible one. I implemented this some time ago but it's fairly complex and difficult to reuse.
Copy linkTweet thisAlerts:
@DrugslarrJul 26.2018 — I also have such problem. I have website on Wordpress about racing. When I put it on the Internet it started to work very slowly. I used [url=https://www.templatemonster.com/category/car-racing-wordpress-themes/]this[/url] theme, but I don't think that it is a problem. Maybe I should change hosting?
Copy linkTweet thisAlerts:
@JayantaboraJul 27.2018 — Hi...you're website loads very slow because many app download in you Davies.. WordPress is very quick app..so you net problem and solved.. But not use new hosting.
Copy linkTweet thisAlerts:
@ezrankingsJul 27.2018 — You can improve your website load time by following below points:-

Optimize Images Properley

Browser Caching

Compression can dramatically reduce your page’s size

Optimized CSS

Put Your Scripts Below the Fold
Copy linkTweet thisAlerts:
@JayantaboraJul 27.2018 — Yes...
Copy linkTweet thisAlerts:
@JayantaboraJul 28.2018 — Yes..I do
Copy linkTweet thisAlerts:
@NagginAug 02.2018 — Try to make tests on https://www.host-tracker.com/InstantCheck/Create. You will get detailed statistics about loading speed, server network connectivity, site-to-application connectivity, etc. Maybe this will help you to understand the problem.
Copy linkTweet thisAlerts:
@VincentTraversAug 03.2018 — ezrankings has provided some good starting points to ensure your site is optimised to load fast. The only additions i would make if you still experience slow loading is to use a CDN and check the wait time on the server. I use pingdom to check load speeds and find this to be a useful tool, although i would only advise its used as a guide.

If your server wait time is consistently long then i would see if your hosting provider will migrate you to another server, or you may wish to explore cloud hosting or a dedicated server if your site gets a lot of traffic.

@Drugslarr#1594282 Wordpress has a number of plugins that will boost the speed of your site and will do some of what @ezrankings#1594297 has suggested. I personally like WP-Rocket however this is a premium plugin so will cost. If your looking for a free plugin W3 Total Cache is a good plugin.

Hope this helps.

Vince
Copy linkTweet thisAlerts:
@rootAug 03.2018 — {"locked":true}
×

Success!

Help @J3nsis spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.10,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...