{"action":"closed","issue":{"url":"https://api.github.com/repos/rs/SDWebImage/issues/1270","repository_url":"https://api.github.com/repos/rs/SDWebImage","labels_url":"https://api.github.com/repos/rs/SDWebImage/issues/1270/labels{/name}","comments_url":"https://api.github.com/repos/rs/SDWebImage/issues/1270/comments","events_url":"https://api.github.com/repos/rs/SDWebImage/issues/1270/events","html_url":"https://github.com/rs/SDWebImage/issues/1270","id":103286802,"number":1270,"title":"Add a multi-cache system for context options (image size, cache size, ...)","user":{"login":"damienrambout","id":1846768,"avatar_url":"https://avatars2.githubusercontent.com/u/1846768?v=4","gravatar_id":"","url":"https://api.github.com/users/damienrambout","html_url":"https://github.com/damienrambout","followers_url":"https://api.github.com/users/damienrambout/followers","following_url":"https://api.github.com/users/damienrambout/following{/other_user}","gists_url":"https://api.github.com/users/damienrambout/gists{/gist_id}","starred_url":"https://api.github.com/users/damienrambout/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/damienrambout/subscriptions","organizations_url":"https://api.github.com/users/damienrambout/orgs","repos_url":"https://api.github.com/users/damienrambout/repos","events_url":"https://api.github.com/users/damienrambout/events{/privacy}","received_events_url":"https://api.github.com/users/damienrambout/received_events","type":"User","site_admin":false},"labels":[{"id":84100,"url":"https://api.github.com/repos/rs/SDWebImage/labels/feature","name":"feature","color":"0f26f7","default":false}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/rs/SDWebImage/milestones/2","html_url":"https://github.com/rs/SDWebImage/milestone/2","labels_url":"https://api.github.com/repos/rs/SDWebImage/milestones/2/labels","id":693613,"number":2,"title":"Future","description":"this is the backlog, triaged issues that are not yet scheduled","creator":{"login":"bpoplauschi","id":154913,"avatar_url":"https://avatars2.githubusercontent.com/u/154913?v=4","gravatar_id":"","url":"https://api.github.com/users/bpoplauschi","html_url":"https://github.com/bpoplauschi","followers_url":"https://api.github.com/users/bpoplauschi/followers","following_url":"https://api.github.com/users/bpoplauschi/following{/other_user}","gists_url":"https://api.github.com/users/bpoplauschi/gists{/gist_id}","starred_url":"https://api.github.com/users/bpoplauschi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bpoplauschi/subscriptions","organizations_url":"https://api.github.com/users/bpoplauschi/orgs","repos_url":"https://api.github.com/users/bpoplauschi/repos","events_url":"https://api.github.com/users/bpoplauschi/events{/privacy}","received_events_url":"https://api.github.com/users/bpoplauschi/received_events","type":"User","site_admin":false},"open_issues":14,"closed_issues":165,"state":"open","created_at":"2014-06-17T14:15:16Z","updated_at":"2018-04-07T13:25:01Z","due_on":null,"closed_at":null},"comments":5,"created_at":"2015-08-26T14:45:44Z","updated_at":"2018-04-07T13:25:01Z","closed_at":"2018-04-07T13:25:01Z","author_association":"NONE","body":"Hi,\n\nThere's something I'm not able to achieve with SDWebImage at the moment: Transform and cache images based on their context.\nThe only information the `SDWebImageManagerDelegate` gets about an image is its url, which is not enough to determine what transform (size, filter, ...) should be applied to an image.\n\nLet's say I have an app that displays a grid of images as first. Each cell of the grid is sized 80x80. Then, in a detail view, the image is sized **200x200**.\n\nI cannot use **500x500** images for my grid because it would have a very bad impact on the scroll performances and memory usage. Same issue for my detail view.\n\nWhat I want is to cache the grid images with a size of **80x80** (maybe even crop them), but just for my grid context. Also I probably need a specific cache size for this context (grid).\nThen cache my detail images  with a size of **200x200**. I believe the global delegate in its current form would not be able to achieve such a thing, because it is global.\n\nI have been using [Haneke](https://github.com/Haneke/Haneke), which defines [caches](https://github.com/Haneke/Haneke/blob/master/Haneke/HNKCache.h) which are in charge of:\n- resizing images (upscale if specified)\n- defining a cache size for its context\n- ...\n\nIt would also be easier to applied custom transforms (such as filters) for each context.\n\nIf SDWebImage could add a context-based multi-cache system, it would make it so much more powerful in terms of flexibility, performance, memory usage, ...\nAnyway, I know it's probably a lot to ask. I don't even know if it would be achievable with the current architecture...\n\nTell me what you think about it.\n\nCheers.\n"}}
{"actor":{"display_login":"dreampiggy"}}