ASP.Netショップの実装を(単純なものから)より柔軟な構造にアップグレードしているところです。製品に関連する画像を保存する方法をいくつか探しています。(2種類の画像があります。製品の親指と、製品のフルビュー画像です)。少なくとも100個の製品を処理する必要があります。
これまでのところ、2つのオプションについて考えています:
1)画像をdbに保存する-画像はDbからストリームに読み込まれ、次に画像に読み込まれます(IHttpHandlerを使用して表示されます)
長所
-画像自体はクラスの一部であり、私たちが使用しているビジネスオブジェクトですコードビハインド
-製品データを維持するための1つの場所
短所
-メモリ消費-他のAPIから製品データを取得するとトラフィックが増加します
2) store images in file system - images are put in page as link
Pros
- none impact on memory as it is not stored in session, app cache.It is used like simple link
- no memory consumption
Cons
- needs to keep some name convention for images in File system (perhaps even some folder structure)
- more complicated maintenance of images
Is there any other suitable mechanism? What would you advice to use?
Personally I prefer images in file system, but it can be harder to maintain it as there are two separate places.
Thanks for any comment. X.
BTW: I can really imagine that in some stage the product will also have some videos or any other media that need to be displayed too. In this case Db is not really option, isn't it?