Django + S3 (boto) + Sorl Thumbnail: Suggestions for optimisation

后端 未结 4 691
臣服心动
臣服心动 2020-12-24 08:40

I am using S3 storage backend across a Django site I am developing, both to reduce load from the EC2 server(s), and to allow multiple webservers (redundancy, load balancing)

4条回答
  •  天涯浪人
    2020-12-24 09:35

    You can use Sorlery. It combines sorl and celery to create thumbnails via workers. It's very careful not to do any filesystem access outside of the worker thread.

    The thumbnail returned immediately (before the worker has had a chance) can be controlled by setting your THUMBNAIL_DUMMY_SOURCE to an appropriate placeholder.

    The job is created the first time the thumbnail is requested, subsequent requests are served the dummy image until the worker thread completes.

提交回复
热议问题