I'm using signed url to generate session uri for resumable upload to gcp storage bucket. The flow is following
- client performs request to the backend, which generates signed url for post request, which is meant to be used to start resumable upload session
- backend generates signed url and returns it to client
- client sends post request to the url to start resumable upload session
- client receives session uri in response and starts uploading large file in multiple chunks (performs multiple put requests to the session uri)
Now the problem is following: during upload client refreshes page and tries to upload a file again. It should start from the last persisted chunk, but as after refresh client asks again backend about signed url, new signed url is being generated by backend, so upload starts from the beggining.
Is there any way to automatically cache signed urls, so for exmaple on backend site, when request for specific path in storage is being performed, I can resuse previous signed url (as long as it's still valid)? Of course I can cache it manually, but I am wondering if there is a way to do it automatically? For example to have always only one valid signed url for specific path in storage?