defendtheweb / NexBot

Node.js IRC bot
Other
8 stars 8 forks source link

Improve imgur module #76

Closed PMaynard closed 10 years ago

PMaynard commented 10 years ago

Use HTTP headers to check for change.

The fastest request is no request. The second fastest is to simply check if the resource on the server has changed. For this you can make use of the HTTP caching > headers like Date, ETags and If-Modified-Since.

Taken from 6 reasons your REST API must come with a client

See Line 55 of the imgur module.

Probably add some better support for performance calls here, as it gets 56 results from Imgur then randomly selects one, it will do this each time because imgur give us 56 random images then update it every hour.