Gallery Pictures are slow loading

Get your Drupal questions answered here!

Gallery Pictures are slow loading

Postby jim » Thu Sep 15, 2011 2:50 pm

The pictures on the Westorangehabitat.org web site are delayed on the new server. When I bring up the web site there are no pictures just Xs where the pictures should be shown. The pictures show up a couple of minutes later. This did not happen on the old server. Why is this occurring and how can it be fixed?

Jim
jim
 
Posts: 18
Joined: Thu Sep 08, 2011 12:23 pm
 

Re: Gallery pictures

Postby Conrad » Thu Sep 15, 2011 8:20 pm

Hello Jim,

I'm not sure why the pictures are slower.

Every browser renders web pages differently. Firefox displays a page one way, IE shows it slightly differently, Opera has its own quirks. What I did was look at the page with Firefox, Opera, and Arora. Opera showed the pictures without a problem. Firefox was absolutely slow to load, just as you said.

Browsers have a cache where they store pages. The idea is that if you visit a page and spend the time downloading images, and come back to the same page 2 minutes later, why, you can pull the images from your local cache almost instantly. No need to wait for a download! I cleared my browser's cache and tried again. Still not great.

Servers have a cache where they store pages. The idea is that if a visitor comes to the website, and the server spends the time building the page before it ships it off across the Internet, and someone comes back to the same page 2 minutes later, why, it can pull the page from the cache and ship it almost instantly.

I have turned on caching for your website.
Turning on caching has 2 important effects:

  1. It makes the website go faster for your visitors. This is good. This is very good.
  2. It makes it harder to edit. This is a bit annoying.
Life is always a compromise, isn't it?

Having your website go faster for visitors is obvious, and doesn't need more explanation.

Making your website harder to edit does need some explanation. You must now remember that caching is turned on whenever you edit a page. You will log in, make an edit, save it, log out, visit the page, and NOT SEE YOUR CHANGE! What's going on? Well, if you were paying attention to the idea of a server cache, you realize that the server has stored the page before you started to edit, and is simply giving you the cached page from before you started to edit.

So now you need to add a step to your editing: clearing the cache.

  1. Log in
  2. Edit your page
  3. Save your page
  4. Clear the cache
  5. Logout
  6. Visit your page to see how it looks as a random user
To clear the cache, you go to:
Drupal -> Site configuration -> Performance
At the bottom of the page, click the "Clear cached data" button.

When you are logged in and editing your page, and saving it, and making a few more changes, and saving it again, this does not apply. Drupal knows you are logged in, and knows you are editing, and shows you your changes. The problem is that you need to log out and visit your page as an anonymous user, and when you do that, if you have not cleared your cache, you will see the old page.

When editing, remember to clear your cache!

I'm hoping this solves the problem.

Cheers,
Conrad
Conrad
Site Admin
 
Posts: 54
Joined: Tue Feb 15, 2011 4:20 pm
Location: GingerFeet LLC
 

Re: Gallery pictures

Postby jim » Fri Sep 16, 2011 3:16 am

Conrad:

Thanks, the pictures are loading faster with the change you made.


Jim
jim
 
Posts: 18
Joined: Thu Sep 08, 2011 12:23 pm
 
 

Return to Drupal How To

Who is online

Users browsing this forum: Google [Bot] and 1 guest

cron