{"action":"created","issue":{"url":"https://api.github.com/repos/silverstripe/silverstripe-framework/issues/4796","labels_url":"https://api.github.com/repos/silverstripe/silverstripe-framework/issues/4796/labels{/name}","comments_url":"https://api.github.com/repos/silverstripe/silverstripe-framework/issues/4796/comments","events_url":"https://api.github.com/repos/silverstripe/silverstripe-framework/issues/4796/events","html_url":"https://github.com/silverstripe/silverstripe-framework/pull/4796","id":118960861,"number":4796,"title":"API Replace CacheGeneratedAssetHandler","user":{"login":"tractorcow","id":936064,"avatar_url":"https://avatars.githubusercontent.com/u/936064?v=3","gravatar_id":"","url":"https://api.github.com/users/tractorcow","html_url":"https://github.com/tractorcow","followers_url":"https://api.github.com/users/tractorcow/followers","following_url":"https://api.github.com/users/tractorcow/following{/other_user}","gists_url":"https://api.github.com/users/tractorcow/gists{/gist_id}","starred_url":"https://api.github.com/users/tractorcow/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tractorcow/subscriptions","organizations_url":"https://api.github.com/users/tractorcow/orgs","repos_url":"https://api.github.com/users/tractorcow/repos","events_url":"https://api.github.com/users/tractorcow/events{/privacy}","received_events_url":"https://api.github.com/users/tractorcow/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/silverstripe/silverstripe-framework/labels/in%20progress","name":"in progress","color":"ededed"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2015-11-26T02:43:28Z","updated_at":"2015-11-29T23:51:17Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/silverstripe/silverstripe-framework/pulls/4796","html_url":"https://github.com/silverstripe/silverstripe-framework/pull/4796","diff_url":"https://github.com/silverstripe/silverstripe-framework/pull/4796.diff","patch_url":"https://github.com/silverstripe/silverstripe-framework/pull/4796.patch"},"body":"API Replace CacheGeneratedAssetHandler with FlysystemGeneratedAssetHandler\r\nAPI Reduce GeneratedAssetHandler API\r\nAPI Re-introduce Requirements::delete_all_combined_files();\r\nAPI Re-introduce Requirements::flush()\r\nAPI Combined files now uses new filenames distinguished by sha1 of sources\r\n\r\nReplaces https://github.com/silverstripe/silverstripe-framework/pull/4709\r\n\r\n\r\nThis fix resolves a core issue with the original implementation of this feature, in that it was mis-using SS_Cache as an intermediary storage mechanism.\r\n\r\nThe new solution (after discussion with @sminnee ) is to use a Flysystem instance as a direct dependency of the `GeneratedAssetStore` implementor, allowing the generated asset store to better control the filename, without having to maintain a SHA1 of the resulting file.\r\n\r\nThis means that we can use `Requirements::delete_all_combined_files` again. :)\r\n\r\nInstead of using mtime to detect changes to the file, the combined hash of all source files are used to generate the resulting filename. This should prevent issues with clustered environments where mtimes might not be synchronised perfectly, or touched over time.\r\n\r\nNote that this is UNLIKE the `AssetStore` api, which uses the hash of the RESULTING file instead.\r\n\r\nCC @caffeineinc on this in case you want to confirm my method here is correct."},"comment":{"url":"https://api.github.com/repos/silverstripe/silverstripe-framework/issues/comments/160483730","html_url":"https://github.com/silverstripe/silverstripe-framework/pull/4796#issuecomment-160483730","issue_url":"https://api.github.com/repos/silverstripe/silverstripe-framework/issues/4796","id":160483730,"user":{"login":"caffeineinc","id":270384,"avatar_url":"https://avatars.githubusercontent.com/u/270384?v=3","gravatar_id":"","url":"https://api.github.com/users/caffeineinc","html_url":"https://github.com/caffeineinc","followers_url":"https://api.github.com/users/caffeineinc/followers","following_url":"https://api.github.com/users/caffeineinc/following{/other_user}","gists_url":"https://api.github.com/users/caffeineinc/gists{/gist_id}","starred_url":"https://api.github.com/users/caffeineinc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/caffeineinc/subscriptions","organizations_url":"https://api.github.com/users/caffeineinc/orgs","repos_url":"https://api.github.com/users/caffeineinc/repos","events_url":"https://api.github.com/users/caffeineinc/events{/privacy}","received_events_url":"https://api.github.com/users/caffeineinc/received_events","type":"User","site_admin":false},"created_at":"2015-11-29T23:51:17Z","updated_at":"2015-11-29T23:51:17Z","body":"it be cool to include a configurable callback too, but default to sha.."}}