casparss / racket-meetup-mobile

Racket Meetup is a tennis social media app built in Typescript with Angular 5 on Ionic 4
0 stars 0 forks source link

Create cache hash for tidying up profile image handling #29

Open casparss opened 7 years ago

casparss commented 7 years ago

Need to improve/replace cache hack for refreshing profile image on the client.

Thinking that rather than appending an ephemeral time stamp to the URL as a query to bust the cache, instead a caching hash will be created for each profile image and generated on the server and stored on the user model. The hash will be a unique ID for the image and be used as a query in the same way as being done already with the time stamp. However the newly generated hash will be returned by the profile pic endpoint and then update the hash prop in the local model instead. This way it tidies up the front-end code and means that the hash always relates to the image and will cache-bust correctly as well.