Reputation: 179
In my web app each user will be having a profile image those images are stored in Amazon s3. If the user signs in i need to show that image and that will stay in the side bar in all the pages he enters. Once he signs in is there anyway i can cache the image so that i no need to get back from Amazon s3 every time ? when he again updates the image i need to clear the cache.
Upvotes: 2
Views: 792
Reputation: 18832
You can use standard Http Caching for this.
You should set the Cache-Control
and/or expires
headers depending on your needs.
All the major S3 clients support setting these headers or you can set using the S3 API's or SDKs/Libraries etc.
In order to re-download the image if it has changed, you can add a querystring to the url. eg
http://mypath/myfile.ext?v=1
http://mypath/myfile.ext?v=2
Upvotes: 1