mohsen solhnia
mohsen solhnia

Reputation: 376

what is the best way to upload images to server? save in database or in server folder?

the problem is browser's cache method where they only can cache images that have server patch, look like: http://cdn.sstatic.net/stackexchange/img/logos/se/se-logo.png

in other hand, if we save images in SQl-server, we have more control(delete, update, search,...) and maintenance ability on images and its other information. but the browsers downloads every time i access it from database. is there a way to cache images that is loaded from database(asp-c#)?

Upvotes: 1

Views: 282

Answers (1)

Dreeco
Dreeco

Reputation: 290

Why not both? You can save path reference in database (along some other useful information about the image such as tags, size, etc.).

Then you can have a controller for your images (update / search / delete) and use .

If you do so, images are still cached by browser

Upvotes: 1

Related Questions