简单的缩略图和s3boto性能

2024-09-28 05:36:48 发布

您现在位置:Python中文网/ 问答频道 /正文

我使用的是Django easy thumbnails 1.1 with THUMBNAIL_DEFAULT_STORAGE='存储。后端.s3boto.S3BotoStorage'。在

我有一个API,它返回一个json图片列表,调整大小以适应iPhone屏幕。在

代码是:

for p in pl:
    photos.append({
        'id': p.id,
        'url': request.build_absolute_uri(
            get_thumbnailer(p.photo)['iPhoneCombo'].url
        ) if p.photo else None,
    })

我注意到get_thumbnailer消耗的时间比使用本地存储器慢4倍。在

我做错什么了吗?或者有什么最佳实践来优化性能?在

谢谢。在


Tags: djangoapiiddefaulturlgetwitheasy

热门问题