Best Way to Store Images for Blogs?

Posted in CategoryGeneral Discussion
  • Terry Ogbemudia 4 months ago
    Caching is basically a way to deliver contents faster, so when users visit your site and download images (view the image content) you want to cache it so that next time when they want to view same content you don’t have to make a request to the server unless the content has changed, so here on Devscreencast videos are caches regionally so that it can be delivered faster, this is a broad topic but you don’t necessarily have to invest a lot of Tim into it since there are open source CDN (Content Deleivery Network) that have done 70% of the work for you. 


    Let me know if you need more details 

  • Hder 4 months ago
    Can you explain what the caching concerns would be and how to approach the issues?
  • Terry Ogbemudia 4 months ago
    I would be more concerned about caching, both options are technically same though option 1 will make things more organised.
  • Hder 4 months ago
    I am developing a blogging system where images can be added to the article.  The image filenames are stored in a database and are retrieved each time the particular blog is requested for display.  My question is, what is the best approach to storing the images.  Expectation would be to have tens of thousands of blogs as the user base grows.  I have two thoughts:

    1.  To create a directory for each blog, using the blog ID.  For example, all images for blog #25 are stored in directory images/blog25/.  There will be a huge amount of sub-directories like this.

    2.  To store all the images in one directory but use the blog ID as a filename differentiator, such as images/25image001.jpg, images/25image002.jpg, etc.  

    Which would provide better performance for retrieval?

    Or does it not make much difference either way?

Please login or register to leave a response.