Images in database

  • Thread starter Luigi Donatello Asero
  • Start date
L

Luigi Donatello Asero

W

William Tasso

Luigi said:
Is it true that I can speed up the loading of a website if I use a
database?

loading data to the web site or loading data from the web site?
I have many images on the website www.scaiecat-spa-gigi.com
and they will probably be more in the future.

I have found the best way to manage images is to store the path info in the
RDBMS - others may have different experience/results.
 
D

David Dorward

Luigi said:
Is it true that I can speed up the loading of a website if I use a
database?

Maybe... but I don't know of any databases that are supposed to be more
efficient then a normal file system[1], and most of the time taken is used
by transferring the data across the network, not in the webserver
retrieving the data from local store.

A database could be used to make it easier for you to _manage_ images, but
it wouldn't impact the speed at which they load.

[1] OK OK, technically speaking a normal file system is a database.
 
A

Art Sackett

William Tasso said:
I have found the best way to manage images is to store the path info in the
RDBMS - others may have different experience/results.

My experience is like yours. And it makes perfect sense, really. All
one needs to do is give the client a URL and let it make a fresh
request. There's no good reason to add two more layers (middleware
and database server) to so simple a transaction as serving a static
file.
 
L

Luigi Donatello Asero

William Tasso said:
loading data to the web site or loading data from the web site?

Uploading I think. I read something somewhere about databases caching images
when the user opens the first page where they are contained. But I am not
sure whether I understood it properly.
For example I have the page
www.scaiecat-spa-gigi.com/sv/italienskkeramikett.html where there are
already two images and according to
http://www.websiteoptimization.com/services/analyze/
they already seem to be too heavy and slowing down the page.
Would a database help?
Of course I could just set a picture on the page otherwise or make images
smaller but are they not already quite small?



- -
Luigi ( un italiano che vive in Svezia)



http://www.scaiecat-spa-gigi.com/sv/italienskkeramikett.html
http://www.scaiecat-spa-gigi.com/sv/boendeitalien.html
 
H

Hywel Jenkins

Uploading I think. I read something somewhere about databases caching images
when the user opens the first page where they are contained. But I am not
sure whether I understood it properly.

Whether the database caches the image is irrelavant. The visitor's
browser still requests them from a URL, that URL either being directly
to a file or to a script that gets the image from a database.

For example I have the page
www.scaiecat-spa-gigi.com/sv/italienskkeramikett.html where there are
already two images and according to
http://www.websiteoptimization.com/services/analyze/
they already seem to be too heavy and slowing down the page.

That software is only beta - maybe there's a fault in it.

Would a database help?

NOt for storing the images, no. The filesystem is already pretty good
at serving images. That said, I just modified a site with content
management to store images in a MySQL database because (for reasons
unkown) I can't delete them if they're uploaded via PHP.

Of course I could just set a picture on the page otherwise or make images
smaller but are they not already quite small?

IMO they're fine. I don't know what they're for because I don't speak
Swedish, but I guess they're for sale.
 
K

kchayka

Luigi said:
For example I have the page
www.scaiecat-spa-gigi.com/sv/italienskkeramikett.html where there are
already two images and according to
http://www.websiteoptimization.com/services/analyze/
they already seem to be too heavy and slowing down the page.

The two images on this page are not quite optimized.
26kb for a ~160x130px jpg is a bit much, it could be compressed quite a
bit more without significant loss of resolution.
Would a database help?

A database will be no help where it comes to image optimization.
 
T

Toby A Inkster

Hywel said:
That said, I just modified a site with content
management to store images in a MySQL database because (for reasons
unkown) I can't delete them if they're uploaded via PHP.

Possibly your images are saved with UID apache and only 'r-x' permissions
for other users.

If this is on your own server, you should be able to fix this using such
concepts as 'umask', but if you are on a shared server, possibly not.
 
H

Hywel Jenkins

Toby A Inkster said:
Possibly your images are saved with UID apache and only 'r-x' permissions
for other users.

If this is on your own server, you should be able to fix this using such
concepts as 'umask', but if you are on a shared server, possibly not.

That is the reason - shared server. Even trying to "unlink" them with
PHP fails, so I figured the database option was the only way to go.
As some of the images are quite large (200kish) the site could quickly
fill up its file store. So far there doesn't seem to be much of a
performance hit on the site.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

Forum statistics

Threads
474,083
Messages
2,570,589
Members
47,211
Latest member
JaydenBail

Latest Threads

Top