{"action":"created","issue":{"url":"https://api.github.com/repos/apache/jena/issues/95","repository_url":"https://api.github.com/repos/apache/jena","labels_url":"https://api.github.com/repos/apache/jena/issues/95/labels{/name}","comments_url":"https://api.github.com/repos/apache/jena/issues/95/comments","events_url":"https://api.github.com/repos/apache/jena/issues/95/events","html_url":"https://github.com/apache/jena/pull/95","id":111955694,"number":95,"title":"JENA-626 SPARQL Query Caching","user":{"login":"samaitra","id":369459,"avatar_url":"https://avatars.githubusercontent.com/u/369459?v=3","gravatar_id":"","url":"https://api.github.com/users/samaitra","html_url":"https://github.com/samaitra","followers_url":"https://api.github.com/users/samaitra/followers","following_url":"https://api.github.com/users/samaitra/following{/other_user}","gists_url":"https://api.github.com/users/samaitra/gists{/gist_id}","starred_url":"https://api.github.com/users/samaitra/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/samaitra/subscriptions","organizations_url":"https://api.github.com/users/samaitra/orgs","repos_url":"https://api.github.com/users/samaitra/repos","events_url":"https://api.github.com/users/samaitra/events{/privacy}","received_events_url":"https://api.github.com/users/samaitra/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":47,"created_at":"2015-10-17T10:27:12Z","updated_at":"2016-04-20T15:48:52Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/apache/jena/pulls/95","html_url":"https://github.com/apache/jena/pull/95","diff_url":"https://github.com/apache/jena/pull/95.diff","patch_url":"https://github.com/apache/jena/pull/95.patch"},"body":"The implementation of SPARQL Query Caching. The initial idea was to create a separate service endpoint that invokes SPARQL_Query. The challenge we faced was to intercept the results data when it is directly written into ServletOutputStream. Currently the results data is copied into cacheBuilder object before it is written to ServletOutputStream. The implementation caches the results for 5 mins and then it invalidates the cache.\r\n\r\nWe have seen good performance benefit with initial test data.\r\n\r\n[2015-10-17 15:43:21] Fuseki     INFO  [2] GET http://localhost:3030/ds/data?default\r\n[2015-10-17 15:43:21] Fuseki     INFO  [2] GET /ds :: 'data' :: <none> ? default\r\n[2015-10-17 15:43:21] Fuseki     INFO  [2] 200 OK (62 ms)\r\n[2015-10-17 15:43:33] Fuseki     INFO  [3] GET http://localhost:3030/ds/data?default\r\n[2015-10-17 15:43:33] Fuseki     INFO  [3] GET /ds :: 'data' :: <none> ? default\r\n[2015-10-17 15:43:33] Fuseki     INFO  [3] 200 OK (7 ms)\r\n[2015-10-17 15:43:50] Fuseki     INFO  [4] GET http://localhost:3030/ds/data?default\r\n[2015-10-17 15:43:50] Fuseki     INFO  [4] GET /ds :: 'data' :: <none> ? default\r\n[2015-10-17 15:43:50] Fuseki     INFO  [4] 200 OK (7 ms) "},"comment":{"url":"https://api.github.com/repos/apache/jena/issues/comments/212484919","html_url":"https://github.com/apache/jena/pull/95#issuecomment-212484919","issue_url":"https://api.github.com/repos/apache/jena/issues/95","id":212484919,"user":{"login":"afs","id":101362,"avatar_url":"https://avatars.githubusercontent.com/u/101362?v=3","gravatar_id":"","url":"https://api.github.com/users/afs","html_url":"https://github.com/afs","followers_url":"https://api.github.com/users/afs/followers","following_url":"https://api.github.com/users/afs/following{/other_user}","gists_url":"https://api.github.com/users/afs/gists{/gist_id}","starred_url":"https://api.github.com/users/afs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/afs/subscriptions","organizations_url":"https://api.github.com/users/afs/orgs","repos_url":"https://api.github.com/users/afs/repos","events_url":"https://api.github.com/users/afs/events{/privacy}","received_events_url":"https://api.github.com/users/afs/received_events","type":"User","site_admin":false},"created_at":"2016-04-20T15:48:52Z","updated_at":"2016-04-20T15:48:52Z","body":"@ajs6f - this is about SELECT results at the moment.  The same principles will apply to model and dataset results but let's stick to result sets for now. \r\n\r\nEven if we capture the result set, not the serialization, a suitable abstraction can be put in place for that to spill to disk in the future.  The Thrift based format is fastest.\r\n\r\nGood point about the shared nodes - query answers share the datasets nodes."}}