开发者

Sorl thumbnail and cache problems

Hello I am trying to get sorl thumbnail to delete cached thumbnails when the image associated with my model is modified. I am accomplishing this using a signal as shown below. The listner is called successfully, yet the cached thumbnail is not being deleted and keeps showing the old thumbnail.

def delete_thumbnail(sender, **kwargs):
f = kwargs.get('file_object')
delete(f, delete_file=False)

EditStudentImage.connect(delete_thumbnail, dispatch_uid="edit_student_image")
开发者_Go百科

Any help would be much appreciated.


Your cache is probably stale. If you are using the cached db key value store it could mean that the cache on top of the db is stale, when that happends (you might have cleared the database table manually and not the cache for it) it does not help for you to use delete like this, and it wont help to clear using the thumbnail clear management command either. You have to clear the cache that is on top of the database manually. This could mean restarting your memcached daemon for example. If you were using redis key value store this would not happend.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜