Skip to content

Prevent caching of responses in Cache.db - #211

Merged
rs merged 1 commit into
SDWebImage:masterfrom
herrernst:master
Nov 5, 2012
Merged

Prevent caching of responses in Cache.db#211
rs merged 1 commit into
SDWebImage:masterfrom
herrernst:master

Conversation

@herrernst

Copy link
Copy Markdown
Contributor

It seems that since iOS 5.0, URL responses also get cached in a file named Cache.db:
http://petersteinberger.com/blog/2012/nsurlcache-uses-a-disk-cache-as-of-ios5/

Because SDWebImage will/can also cache images, you end up using twice the disk space (and IO).

Here are two screenshots showing this behaviour on the simulator and on the device:

http://i.imgur.com/6c2Cv.jpg
http://i.imgur.com/3xWFC.png

I've added a delegate method implementation to avoid caching in Cache.db. Feel free to merge or adopt.

@rs rs closed this in f03729c Nov 5, 2012
rs pushed a commit that referenced this pull request Nov 5, 2012
@rs

rs commented Nov 5, 2012

Copy link
Copy Markdown
Member

Please confirm it fixed the issue for you

@herrernst

Copy link
Copy Markdown
Contributor Author

Unfortunately, this doesn't seem to change anything, Cache.db is still growing when showing images ...

@rs rs reopened this Nov 5, 2012
rs pushed a commit that referenced this pull request Nov 5, 2012
Prevent caching of responses in Cache.db
@rs
rs merged commit 6df9f76 into SDWebImage:master Nov 5, 2012
rs pushed a commit that referenced this pull request Nov 5, 2012
@herrernst

Copy link
Copy Markdown
Contributor Author

Thanks!

hawflakes pushed a commit to hawflakes/SDWebImage that referenced this pull request Mar 13, 2013
hawflakes pushed a commit to hawflakes/SDWebImage that referenced this pull request Mar 13, 2013
@herrernst
herrernst deleted the master branch April 26, 2014 10:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants