{"action":"created","issue":{"url":"https://api.github.com/repos/OrchardCMS/Orchard/issues/6115","labels_url":"https://api.github.com/repos/OrchardCMS/Orchard/issues/6115/labels{/name}","comments_url":"https://api.github.com/repos/OrchardCMS/Orchard/issues/6115/comments","events_url":"https://api.github.com/repos/OrchardCMS/Orchard/issues/6115/events","html_url":"https://github.com/OrchardCMS/Orchard/issues/6115","id":119758761,"number":6115,"title":"File System Output Cache can generate file paths that are too long - can't access the page at all","user":{"login":"joshberry","id":1396816,"avatar_url":"https://avatars.githubusercontent.com/u/1396816?v=3","gravatar_id":"","url":"https://api.github.com/users/joshberry","html_url":"https://github.com/joshberry","followers_url":"https://api.github.com/users/joshberry/followers","following_url":"https://api.github.com/users/joshberry/following{/other_user}","gists_url":"https://api.github.com/users/joshberry/gists{/gist_id}","starred_url":"https://api.github.com/users/joshberry/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joshberry/subscriptions","organizations_url":"https://api.github.com/users/joshberry/orgs","repos_url":"https://api.github.com/users/joshberry/repos","events_url":"https://api.github.com/users/joshberry/events{/privacy}","received_events_url":"https://api.github.com/users/joshberry/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-12-01T16:47:07Z","updated_at":"2015-12-01T18:17:54Z","closed_at":null,"body":"Depending on the directory structure on the host and the parameters for a particular request, the file system output cache feature can generate file paths that are too long to handle. The result when this happens is an exception and the inability to access the page.\r\n\r\n![image](https://cloud.githubusercontent.com/assets/1396816/11507049/d4057c40-9817-11e5-934b-23d4969bccf8.png)\r\n\r\nThe actual exception is below but gets caught and thrown as what you see above: \r\n```\r\nPath.GetFullPath(mappedPath).StartsWith(Path.GetFullPath(basePath), StringComparison.OrdinalIgnoreCase)\t'Path.GetFullPath(mappedPath).StartsWith(Path.GetFullPath(basePath), StringComparison.OrdinalIgnoreCase)' threw an exception of type 'System.IO.PathTooLongException'\tbool {System.IO.PathTooLongException}\r\n```\r\n\r\nI understand that the technique used for this feature relies on embedding the parameters in the file name. But it would be much better if a check was added to prevent this failure so even if the page can't be cached, it will at least allow access to the non-cached page.\r\n"},"comment":{"url":"https://api.github.com/repos/OrchardCMS/Orchard/issues/comments/161052788","html_url":"https://github.com/OrchardCMS/Orchard/issues/6115#issuecomment-161052788","issue_url":"https://api.github.com/repos/OrchardCMS/Orchard/issues/6115","id":161052788,"user":{"login":"joshberry","id":1396816,"avatar_url":"https://avatars.githubusercontent.com/u/1396816?v=3","gravatar_id":"","url":"https://api.github.com/users/joshberry","html_url":"https://github.com/joshberry","followers_url":"https://api.github.com/users/joshberry/followers","following_url":"https://api.github.com/users/joshberry/following{/other_user}","gists_url":"https://api.github.com/users/joshberry/gists{/gist_id}","starred_url":"https://api.github.com/users/joshberry/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joshberry/subscriptions","organizations_url":"https://api.github.com/users/joshberry/orgs","repos_url":"https://api.github.com/users/joshberry/repos","events_url":"https://api.github.com/users/joshberry/events{/privacy}","received_events_url":"https://api.github.com/users/joshberry/received_events","type":"User","site_admin":false},"created_at":"2015-12-01T18:17:54Z","updated_at":"2015-12-01T18:17:54Z","body":"I'm just starting to use it as we're upgrading sites to 1.9.2, but the performance has been great so far. To my eye, it appears just as fast as the in-memory output cache.\r\n\r\nUsing a url hash for the file name seems like a good solution. I have a temporary workaround in place to check for file paths over 259 characters and bypass caching them. Do you think that would be a useful temporary fix for 1.9.x? If so, I can submit it. I'd also be happy to help with the solution you proposed.\r\n\r\n"}}