Answer the question
In order to leave comments, you need to log in
What is the best way to store pictures?
I have been thinking about it for several weeks now, I can’t decide how to properly and best store pictures on a culinary site.
There is a recipe, it has a main picture and steps for the recipe. an average of 10 pictures per recipe. Each picture has a reduced copy, medium and original. Is it correct from the point of view of seo and some future subtleties, will it store pictures in such directories and with the title of the article in transliteration.
/uploads/images/id_post/thumb/tort_minutka.jpg
/uploads/images/id_post/main/tort_minutka.jpg
/uploads/images/id_post/original/tort_minutka.jpg
/uploads/images/
will be a huge number of folders with article ids in the directory. Answer the question
In order to leave comments, you need to log in
It is better to name the folder not as id, but as some simple hash function from this id. Moreover, do not put everything on one level, but distribute them into 2-3. Below is an example for an article with id=123
md5(123) = 202cb962ac59075b964b07152d234b70
берем первый символ хеша - 2, создаем папку "2" в /uploads/images
берем второй символ хеша - 0, создаем папку "0" в /uploads/images/2
создаем папку "202cb962ac59075b964b07152d234b70" в /uploads/images/2/0/
кладём в /uploads/images/2/0/202cb962ac59075b964b07152d234b70 нужные файлы
I think it's more logical:
/uploads/images/id_post/tort_minutka.thumb.jpg
/uploads/images/id_post/tort_minutka.main.jpg
/uploads/images/id_post/tort_minutka.original.jpg
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question