{"action":"created","comment":{"url":"https://api.github.com/repos/jcabi/jcabi-http/pulls/comments/49342152","id":49342152,"diff_hunk":"@@ -0,0 +1,202 @@\n+/**\n+ * Copyright (c) 2011-2015, jcabi.com\n+ * All rights reserved.\n+ *\n+ * Redistribution and use in source and binary forms, with or without\n+ * modification, are permitted provided that the following conditions\n+ * are met: 1) Redistributions of source code must retain the above\n+ * copyright notice, this list of conditions and the following\n+ * disclaimer. 2) Redistributions in binary form must reproduce the above\n+ * copyright notice, this list of conditions and the following\n+ * disclaimer in the documentation and/or other materials provided\n+ * with the distribution. 3) Neither the name of the jcabi.com nor\n+ * the names of its contributors may be used to endorse or promote\n+ * products derived from this software without specific prior written\n+ * permission.\n+ *\n+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n+ * \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT\n+ * NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL\n+ * THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,\n+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\n+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED\n+ * OF THE POSSIBILITY OF SUCH DAMAGE.\n+ */\n+package com.jcabi.http.wire;\n+\n+import com.jcabi.http.Request;\n+import com.jcabi.http.Response;\n+import com.jcabi.http.Wire;\n+import java.io.IOException;\n+import java.io.InputStream;\n+import java.net.HttpURLConnection;\n+import java.util.Collection;\n+import java.util.List;\n+import java.util.Map;\n+import java.util.concurrent.ConcurrentHashMap;\n+\n+/**\n+ * Wire that caches requests based on (for five minutes).\n+ * @author Igor Piddubnyi (igor.piddubnyi@gmail.com)\n+ * @version $Id$\n+ * @since 1.0\n+ */\n+public class LastModifiedCashingWire implements Wire {","path":"src/main/java/com/jcabi/http/wire/LastModifiedCashingWire.java","position":49,"original_position":49,"commit_id":"9262f8ab61f4905fbc5ef064cb46a089bb57eb77","original_commit_id":"9262f8ab61f4905fbc5ef064cb46a089bb57eb77","user":{"login":"pinaf","id":1054771,"avatar_url":"https://avatars.githubusercontent.com/u/1054771?v=3","gravatar_id":"","url":"https://api.github.com/users/pinaf","html_url":"https://github.com/pinaf","followers_url":"https://api.github.com/users/pinaf/followers","following_url":"https://api.github.com/users/pinaf/following{/other_user}","gists_url":"https://api.github.com/users/pinaf/gists{/gist_id}","starred_url":"https://api.github.com/users/pinaf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pinaf/subscriptions","organizations_url":"https://api.github.com/users/pinaf/orgs","repos_url":"https://api.github.com/users/pinaf/repos","events_url":"https://api.github.com/users/pinaf/events{/privacy}","received_events_url":"https://api.github.com/users/pinaf/received_events","type":"User","site_admin":false},"body":"@piddubnyi final","created_at":"2016-01-11T16:31:54Z","updated_at":"2016-01-11T16:31:54Z","html_url":"https://github.com/jcabi/jcabi-http/pull/118#discussion_r49342152","pull_request_url":"https://api.github.com/repos/jcabi/jcabi-http/pulls/118","_links":{"self":{"href":"https://api.github.com/repos/jcabi/jcabi-http/pulls/comments/49342152"},"html":{"href":"https://github.com/jcabi/jcabi-http/pull/118#discussion_r49342152"},"pull_request":{"href":"https://api.github.com/repos/jcabi/jcabi-http/pulls/118"}}},"pull_request":{"url":"https://api.github.com/repos/jcabi/jcabi-http/pulls/118","id":55463664,"html_url":"https://github.com/jcabi/jcabi-http/pull/118","diff_url":"https://github.com/jcabi/jcabi-http/pull/118.diff","patch_url":"https://github.com/jcabi/jcabi-http/pull/118.patch","issue_url":"https://api.github.com/repos/jcabi/jcabi-http/issues/118","number":118,"state":"open","locked":false,"title":"Caching based on the Last-Modified and If-Modified-Since headers","user":{"login":"piddubnyi","id":6010247,"avatar_url":"https://avatars.githubusercontent.com/u/6010247?v=3","gravatar_id":"","url":"https://api.github.com/users/piddubnyi","html_url":"https://github.com/piddubnyi","followers_url":"https://api.github.com/users/piddubnyi/followers","following_url":"https://api.github.com/users/piddubnyi/following{/other_user}","gists_url":"https://api.github.com/users/piddubnyi/gists{/gist_id}","starred_url":"https://api.github.com/users/piddubnyi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/piddubnyi/subscriptions","organizations_url":"https://api.github.com/users/piddubnyi/orgs","repos_url":"https://api.github.com/users/piddubnyi/repos","events_url":"https://api.github.com/users/piddubnyi/events{/privacy}","received_events_url":"https://api.github.com/users/piddubnyi/received_events","type":"User","site_admin":false},"body":"Implemented LastModifiedCashingWire that performs cashing based on Last-Modified and If-Modified-Since headers.\r\nhttps://github.com/jcabi/jcabi-http/issues/90","created_at":"2016-01-08T13:55:35Z","updated_at":"2016-01-11T16:31:54Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f1e4b21e93baaa5625a5a4f2fea16b757c44a9d2","assignee":{"login":"pinaf","id":1054771,"avatar_url":"https://avatars.githubusercontent.com/u/1054771?v=3","gravatar_id":"","url":"https://api.github.com/users/pinaf","html_url":"https://github.com/pinaf","followers_url":"https://api.github.com/users/pinaf/followers","following_url":"https://api.github.com/users/pinaf/following{/other_user}","gists_url":"https://api.github.com/users/pinaf/gists{/gist_id}","starred_url":"https://api.github.com/users/pinaf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pinaf/subscriptions","organizations_url":"https://api.github.com/users/pinaf/orgs","repos_url":"https://api.github.com/users/pinaf/repos","events_url":"https://api.github.com/users/pinaf/events{/privacy}","received_events_url":"https://api.github.com/users/pinaf/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/jcabi/jcabi-http/pulls/118/commits","review_comments_url":"https://api.github.com/repos/jcabi/jcabi-http/pulls/118/comments","review_comment_url":"https://api.github.com/repos/jcabi/jcabi-http/pulls/comments{/number}","comments_url":"https://api.github.com/repos/jcabi/jcabi-http/issues/118/comments","statuses_url":"https://api.github.com/repos/jcabi/jcabi-http/statuses/9262f8ab61f4905fbc5ef064cb46a089bb57eb77","head":{"label":"piddubnyi:master","ref":"master","sha":"9262f8ab61f4905fbc5ef064cb46a089bb57eb77","user":{"login":"piddubnyi","id":6010247,"avatar_url":"https://avatars.githubusercontent.com/u/6010247?v=3","gravatar_id":"","url":"https://api.github.com/users/piddubnyi","html_url":"https://github.com/piddubnyi","followers_url":"https://api.github.com/users/piddubnyi/followers","following_url":"https://api.github.com/users/piddubnyi/following{/other_user}","gists_url":"https://api.github.com/users/piddubnyi/gists{/gist_id}","starred_url":"https://api.github.com/users/piddubnyi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/piddubnyi/subscriptions","organizations_url":"https://api.github.com/users/piddubnyi/orgs","repos_url":"https://api.github.com/users/piddubnyi/repos","events_url":"https://api.github.com/users/piddubnyi/events{/privacy}","received_events_url":"https://api.github.com/users/piddubnyi/received_events","type":"User","site_admin":false},"repo":{"id":49208026,"name":"jcabi-http","full_name":"piddubnyi/jcabi-http","owner":{"login":"piddubnyi","id":6010247,"avatar_url":"https://avatars.githubusercontent.com/u/6010247?v=3","gravatar_id":"","url":"https://api.github.com/users/piddubnyi","html_url":"https://github.com/piddubnyi","followers_url":"https://api.github.com/users/piddubnyi/followers","following_url":"https://api.github.com/users/piddubnyi/following{/other_user}","gists_url":"https://api.github.com/users/piddubnyi/gists{/gist_id}","starred_url":"https://api.github.com/users/piddubnyi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/piddubnyi/subscriptions","organizations_url":"https://api.github.com/users/piddubnyi/orgs","repos_url":"https://api.github.com/users/piddubnyi/repos","events_url":"https://api.github.com/users/piddubnyi/events{/privacy}","received_events_url":"https://api.github.com/users/piddubnyi/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/piddubnyi/jcabi-http","description":"Fluent Java HTTP client","fork":true,"url":"https://api.github.com/repos/piddubnyi/jcabi-http","forks_url":"https://api.github.com/repos/piddubnyi/jcabi-http/forks","keys_url":"https://api.github.com/repos/piddubnyi/jcabi-http/keys{/key_id}","collaborators_url":"https://api.github.com/repos/piddubnyi/jcabi-http/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/piddubnyi/jcabi-http/teams","hooks_url":"https://api.github.com/repos/piddubnyi/jcabi-http/hooks","issue_events_url":"https://api.github.com/repos/piddubnyi/jcabi-http/issues/events{/number}","events_url":"https://api.github.com/repos/piddubnyi/jcabi-http/events","assignees_url":"https://api.github.com/repos/piddubnyi/jcabi-http/assignees{/user}","branches_url":"https://api.github.com/repos/piddubnyi/jcabi-http/branches{/branch}","tags_url":"https://api.github.com/repos/piddubnyi/jcabi-http/tags","blobs_url":"https://api.github.com/repos/piddubnyi/jcabi-http/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/piddubnyi/jcabi-http/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/piddubnyi/jcabi-http/git/refs{/sha}","trees_url":"https://api.github.com/repos/piddubnyi/jcabi-http/git/trees{/sha}","statuses_url":"https://api.github.com/repos/piddubnyi/jcabi-http/statuses/{sha}","languages_url":"https://api.github.com/repos/piddubnyi/jcabi-http/languages","stargazers_url":"https://api.github.com/repos/piddubnyi/jcabi-http/stargazers","contributors_url":"https://api.github.com/repos/piddubnyi/jcabi-http/contributors","subscribers_url":"https://api.github.com/repos/piddubnyi/jcabi-http/subscribers","subscription_url":"https://api.github.com/repos/piddubnyi/jcabi-http/subscription","commits_url":"https://api.github.com/repos/piddubnyi/jcabi-http/commits{/sha}","git_commits_url":"https://api.github.com/repos/piddubnyi/jcabi-http/git/commits{/sha}","comments_url":"https://api.github.com/repos/piddubnyi/jcabi-http/comments{/number}","issue_comment_url":"https://api.github.com/repos/piddubnyi/jcabi-http/issues/comments{/number}","contents_url":"https://api.github.com/repos/piddubnyi/jcabi-http/contents/{+path}","compare_url":"https://api.github.com/repos/piddubnyi/jcabi-http/compare/{base}...{head}","merges_url":"https://api.github.com/repos/piddubnyi/jcabi-http/merges","archive_url":"https://api.github.com/repos/piddubnyi/jcabi-http/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/piddubnyi/jcabi-http/downloads","issues_url":"https://api.github.com/repos/piddubnyi/jcabi-http/issues{/number}","pulls_url":"https://api.github.com/repos/piddubnyi/jcabi-http/pulls{/number}","milestones_url":"https://api.github.com/repos/piddubnyi/jcabi-http/milestones{/number}","notifications_url":"https://api.github.com/repos/piddubnyi/jcabi-http/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/piddubnyi/jcabi-http/labels{/name}","releases_url":"https://api.github.com/repos/piddubnyi/jcabi-http/releases{/id}","created_at":"2016-01-07T14:05:28Z","updated_at":"2016-01-07T14:05:29Z","pushed_at":"2016-01-08T14:04:13Z","git_url":"git://github.com/piddubnyi/jcabi-http.git","ssh_url":"git@github.com:piddubnyi/jcabi-http.git","clone_url":"https://github.com/piddubnyi/jcabi-http.git","svn_url":"https://github.com/piddubnyi/jcabi-http","homepage":"http.jcabi.com","size":5931,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"jcabi:master","ref":"master","sha":"9bf202f1d8da7d8660141ee6ea155bb4bc2cac1b","user":{"login":"jcabi","id":5272640,"avatar_url":"https://avatars.githubusercontent.com/u/5272640?v=3","gravatar_id":"","url":"https://api.github.com/users/jcabi","html_url":"https://github.com/jcabi","followers_url":"https://api.github.com/users/jcabi/followers","following_url":"https://api.github.com/users/jcabi/following{/other_user}","gists_url":"https://api.github.com/users/jcabi/gists{/gist_id}","starred_url":"https://api.github.com/users/jcabi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jcabi/subscriptions","organizations_url":"https://api.github.com/users/jcabi/orgs","repos_url":"https://api.github.com/users/jcabi/repos","events_url":"https://api.github.com/users/jcabi/events{/privacy}","received_events_url":"https://api.github.com/users/jcabi/received_events","type":"Organization","site_admin":false},"repo":{"id":16312153,"name":"jcabi-http","full_name":"jcabi/jcabi-http","owner":{"login":"jcabi","id":5272640,"avatar_url":"https://avatars.githubusercontent.com/u/5272640?v=3","gravatar_id":"","url":"https://api.github.com/users/jcabi","html_url":"https://github.com/jcabi","followers_url":"https://api.github.com/users/jcabi/followers","following_url":"https://api.github.com/users/jcabi/following{/other_user}","gists_url":"https://api.github.com/users/jcabi/gists{/gist_id}","starred_url":"https://api.github.com/users/jcabi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jcabi/subscriptions","organizations_url":"https://api.github.com/users/jcabi/orgs","repos_url":"https://api.github.com/users/jcabi/repos","events_url":"https://api.github.com/users/jcabi/events{/privacy}","received_events_url":"https://api.github.com/users/jcabi/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/jcabi/jcabi-http","description":"Fluent Java HTTP client","fork":false,"url":"https://api.github.com/repos/jcabi/jcabi-http","forks_url":"https://api.github.com/repos/jcabi/jcabi-http/forks","keys_url":"https://api.github.com/repos/jcabi/jcabi-http/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jcabi/jcabi-http/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jcabi/jcabi-http/teams","hooks_url":"https://api.github.com/repos/jcabi/jcabi-http/hooks","issue_events_url":"https://api.github.com/repos/jcabi/jcabi-http/issues/events{/number}","events_url":"https://api.github.com/repos/jcabi/jcabi-http/events","assignees_url":"https://api.github.com/repos/jcabi/jcabi-http/assignees{/user}","branches_url":"https://api.github.com/repos/jcabi/jcabi-http/branches{/branch}","tags_url":"https://api.github.com/repos/jcabi/jcabi-http/tags","blobs_url":"https://api.github.com/repos/jcabi/jcabi-http/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jcabi/jcabi-http/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jcabi/jcabi-http/git/refs{/sha}","trees_url":"https://api.github.com/repos/jcabi/jcabi-http/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jcabi/jcabi-http/statuses/{sha}","languages_url":"https://api.github.com/repos/jcabi/jcabi-http/languages","stargazers_url":"https://api.github.com/repos/jcabi/jcabi-http/stargazers","contributors_url":"https://api.github.com/repos/jcabi/jcabi-http/contributors","subscribers_url":"https://api.github.com/repos/jcabi/jcabi-http/subscribers","subscription_url":"https://api.github.com/repos/jcabi/jcabi-http/subscription","commits_url":"https://api.github.com/repos/jcabi/jcabi-http/commits{/sha}","git_commits_url":"https://api.github.com/repos/jcabi/jcabi-http/git/commits{/sha}","comments_url":"https://api.github.com/repos/jcabi/jcabi-http/comments{/number}","issue_comment_url":"https://api.github.com/repos/jcabi/jcabi-http/issues/comments{/number}","contents_url":"https://api.github.com/repos/jcabi/jcabi-http/contents/{+path}","compare_url":"https://api.github.com/repos/jcabi/jcabi-http/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jcabi/jcabi-http/merges","archive_url":"https://api.github.com/repos/jcabi/jcabi-http/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jcabi/jcabi-http/downloads","issues_url":"https://api.github.com/repos/jcabi/jcabi-http/issues{/number}","pulls_url":"https://api.github.com/repos/jcabi/jcabi-http/pulls{/number}","milestones_url":"https://api.github.com/repos/jcabi/jcabi-http/milestones{/number}","notifications_url":"https://api.github.com/repos/jcabi/jcabi-http/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jcabi/jcabi-http/labels{/name}","releases_url":"https://api.github.com/repos/jcabi/jcabi-http/releases{/id}","created_at":"2014-01-28T13:12:40Z","updated_at":"2015-12-15T07:27:20Z","pushed_at":"2016-01-08T14:04:13Z","git_url":"git://github.com/jcabi/jcabi-http.git","ssh_url":"git@github.com:jcabi/jcabi-http.git","clone_url":"https://github.com/jcabi/jcabi-http.git","svn_url":"https://github.com/jcabi/jcabi-http","homepage":"http.jcabi.com","size":5972,"stargazers_count":59,"watchers_count":59,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":24,"mirror_url":null,"open_issues_count":13,"forks":24,"open_issues":13,"watchers":59,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/jcabi/jcabi-http/pulls/118"},"html":{"href":"https://github.com/jcabi/jcabi-http/pull/118"},"issue":{"href":"https://api.github.com/repos/jcabi/jcabi-http/issues/118"},"comments":{"href":"https://api.github.com/repos/jcabi/jcabi-http/issues/118/comments"},"review_comments":{"href":"https://api.github.com/repos/jcabi/jcabi-http/pulls/118/comments"},"review_comment":{"href":"https://api.github.com/repos/jcabi/jcabi-http/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/jcabi/jcabi-http/pulls/118/commits"},"statuses":{"href":"https://api.github.com/repos/jcabi/jcabi-http/statuses/9262f8ab61f4905fbc5ef064cb46a089bb57eb77"}}}}