evazion / translate-pixiv-tags

MIT License
35 stars 6 forks source link

Use GM storage to facilitate upgradeproof settings #13

Closed BrokenEagle closed 5 years ago

BrokenEagle commented 5 years ago

This will allow users to maintain settings without having to either disable updates or repatch after every update. The settings will be available from the Storage tab.

image

7nik commented 5 years ago

Btw, I feel that timestamp shouldn't be calculated in this way, but I'm not sure because I couldn't find docs for the expiry and the timestamp params.

BrokenEagle commented 5 years ago

@7nik As explained to me by @evazion on Discord, the timestamp is just a dummy parameter sent to artificially modify the URL so that a new response is received.

The only real parameter that deals with caching is expiry. That parameter represents the number of days to cache the response, and is integer based, so normally expirations have to be chosen on a day boundary. Timestamp was added as a way around that limitation, as any changes to the URL causes a cache miss, and therefore a new network request.

7nik commented 5 years ago

@BrokenEagle Thank you for the explanation. Now I see why the dividing on cache confused me.