{"action":"created","issue":{"url":"https://api.github.com/repos/minio/minio-js/issues/724","repository_url":"https://api.github.com/repos/minio/minio-js","labels_url":"https://api.github.com/repos/minio/minio-js/issues/724/labels{/name}","comments_url":"https://api.github.com/repos/minio/minio-js/issues/724/comments","events_url":"https://api.github.com/repos/minio/minio-js/issues/724/events","html_url":"https://github.com/minio/minio-js/issues/724","id":372863726,"node_id":"MDU6SXNzdWUzNzI4NjM3MjY=","number":724,"title":"Make requestDate a parameter for presignedUrl","user":{"login":"dustin-H","id":6003519,"node_id":"MDQ6VXNlcjYwMDM1MTk=","avatar_url":"https://avatars0.githubusercontent.com/u/6003519?v=4","gravatar_id":"","url":"https://api.github.com/users/dustin-H","html_url":"https://github.com/dustin-H","followers_url":"https://api.github.com/users/dustin-H/followers","following_url":"https://api.github.com/users/dustin-H/following{/other_user}","gists_url":"https://api.github.com/users/dustin-H/gists{/gist_id}","starred_url":"https://api.github.com/users/dustin-H/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dustin-H/subscriptions","organizations_url":"https://api.github.com/users/dustin-H/orgs","repos_url":"https://api.github.com/users/dustin-H/repos","events_url":"https://api.github.com/users/dustin-H/events{/privacy}","received_events_url":"https://api.github.com/users/dustin-H/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-10-23T08:11:21Z","updated_at":"2018-10-23T19:15:01Z","closed_at":null,"author_association":"NONE","body":"Hi there,\r\n\r\nI'm using presigned urls pretty much in my projects. However, one problem is, that a client is reloading all images when it gets new urls. It is not cacheable by the browser as my server always responds new presigned urls with every request.\r\n\r\nA solution would be to respond the same signed url within e.g. one day. So the client wouldn't get a new url with each and every request but instead one per day as it is cached.\r\n\r\nHowever, a cache would need to store a lot of presigned urls, which I would like to avoid.\r\n\r\nSo I came to the idea of issuing all presigned urls to the beginning of the day. For example regardless of whether a file is requested at 9AM or 9PM, the server would respond a presigned url issued at 12AM (9 or 21 hours before). The signature would expire for example after 48 hours. This would respond the same presigned url on one day with every request.\r\n\r\nTo implement this, I need to set the `requestDate` in https://github.com/minio/minio-js/blob/master/src/main/minio.js#L1562.\r\n\r\nMy suggestion would be to add an optional parameter (`requestDate`) to the functions `presignedUrl()`, `presignedGetObject()` and `presignedPutObject()`.\r\n\r\nWhat do you think about that?\r\n\r\nIf you agree, I would create a PR.\r\n\r\nCheers, Dustin"},"comment":{"url":"https://api.github.com/repos/minio/minio-js/issues/comments/432381953","html_url":"https://github.com/minio/minio-js/issues/724#issuecomment-432381953","issue_url":"https://api.github.com/repos/minio/minio-js/issues/724","id":432381953,"node_id":"MDEyOklzc3VlQ29tbWVudDQzMjM4MTk1Mw==","user":{"login":"kannappanr","id":30541348,"node_id":"MDQ6VXNlcjMwNTQxMzQ4","avatar_url":"https://avatars0.githubusercontent.com/u/30541348?v=4","gravatar_id":"","url":"https://api.github.com/users/kannappanr","html_url":"https://github.com/kannappanr","followers_url":"https://api.github.com/users/kannappanr/followers","following_url":"https://api.github.com/users/kannappanr/following{/other_user}","gists_url":"https://api.github.com/users/kannappanr/gists{/gist_id}","starred_url":"https://api.github.com/users/kannappanr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kannappanr/subscriptions","organizations_url":"https://api.github.com/users/kannappanr/orgs","repos_url":"https://api.github.com/users/kannappanr/repos","events_url":"https://api.github.com/users/kannappanr/events{/privacy}","received_events_url":"https://api.github.com/users/kannappanr/received_events","type":"User","site_admin":false},"created_at":"2018-10-23T19:15:01Z","updated_at":"2018-10-23T19:15:01Z","author_association":"CONTRIBUTOR","body":"@dustin-H You can use either `Cache-Controle` or `Expires` header as explained in https://docs.aws.amazon.com/AmazonS3/latest/API/RESTObjectPUT.html . "}}
{"actor":{"display_login":"kannappanr"}}