{"action":"created","issue":{"url":"https://api.github.com/repos/facebook/fresco/issues/243","labels_url":"https://api.github.com/repos/facebook/fresco/issues/243/labels{/name}","comments_url":"https://api.github.com/repos/facebook/fresco/issues/243/comments","events_url":"https://api.github.com/repos/facebook/fresco/issues/243/events","html_url":"https://github.com/facebook/fresco/issues/243","id":74290047,"number":243,"title":"why getMainDiskStorageCache method call the getSmallDiskStorageCache","user":{"login":"binqiangsun","id":8416392,"avatar_url":"https://avatars.githubusercontent.com/u/8416392?v=3","gravatar_id":"","url":"https://api.github.com/users/binqiangsun","html_url":"https://github.com/binqiangsun","followers_url":"https://api.github.com/users/binqiangsun/followers","following_url":"https://api.github.com/users/binqiangsun/following{/other_user}","gists_url":"https://api.github.com/users/binqiangsun/gists{/gist_id}","starred_url":"https://api.github.com/users/binqiangsun/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/binqiangsun/subscriptions","organizations_url":"https://api.github.com/users/binqiangsun/orgs","repos_url":"https://api.github.com/users/binqiangsun/repos","events_url":"https://api.github.com/users/binqiangsun/events{/privacy}","received_events_url":"https://api.github.com/users/binqiangsun/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-05-08T08:53:42Z","updated_at":"2015-05-08T15:00:54Z","closed_at":"2015-05-08T15:00:54Z","body":"I wrote the disk cache of fresco as followed:\r\n\r\nDiskCacheConfig diskCacheConfig = DiskCacheConfig.newBuilder()\r\n                .setMaxCacheSize(DISK_CACHE_SIZE_HIGH)\r\n                .setMaxCacheSizeOnLowDiskSpace(DISK_CACHE_SIZE_LOW)\r\n                .setMaxCacheSizeOnVeryLowDiskSpace(DISK_CACHE_SIZE_VERY_LOW)\r\n                .setBaseDirectoryName(diskCacheUniqueName)\r\n                .setBaseDirectoryPath(getDiskCacheDir(context, diskCacheUniqueName))\r\n                .setVersion(getAppVersion(context))\r\n                .build();\r\nImagePipelineConfig config = ImagePipelineConfig.newBuilder(context)\r\n        .setMainDiskCacheConfig(diskCacheConfig)\r\n\r\nThen I want to get the size of disk cache, I call the method of \"getMainDiskStorageCache().getsize()\"\r\nBut it returned -1.\r\n\r\nI debuged the code and found that getMainDiskStorageCache() not called but getSmallDiskStorageCache() called. \r\n\r\nI am confused.\r\n"},"comment":{"url":"https://api.github.com/repos/facebook/fresco/issues/comments/100263312","html_url":"https://github.com/facebook/fresco/issues/243#issuecomment-100263312","issue_url":"https://api.github.com/repos/facebook/fresco/issues/243","id":100263312,"user":{"login":"tyronen","id":958570,"avatar_url":"https://avatars.githubusercontent.com/u/958570?v=3","gravatar_id":"","url":"https://api.github.com/users/tyronen","html_url":"https://github.com/tyronen","followers_url":"https://api.github.com/users/tyronen/followers","following_url":"https://api.github.com/users/tyronen/following{/other_user}","gists_url":"https://api.github.com/users/tyronen/gists{/gist_id}","starred_url":"https://api.github.com/users/tyronen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tyronen/subscriptions","organizations_url":"https://api.github.com/users/tyronen/orgs","repos_url":"https://api.github.com/users/tyronen/repos","events_url":"https://api.github.com/users/tyronen/events{/privacy}","received_events_url":"https://api.github.com/users/tyronen/received_events","type":"User","site_admin":false},"created_at":"2015-05-08T15:00:54Z","updated_at":"2015-05-08T15:00:54Z","body":"Most apps only use one cache. So by default, the small disk cache is the same as the main disk cache.\r\n\r\nYou have to explicitly call `setSmallDiskCacheConfig` with a different config, as explained in http://frescolib.org/docs/caching.html#using-one-disk-cache-or-two"}}