Example Performance Tips

Use the E-Tag HTTP Header

The ETag key is a hash that represents our last response. If you provide the If-None-Match header with this key, we will only send you content if its new and worth your waiting. Otherwise we just return a 304 header and skip the body re-generation.
This can dramatically improve performance for repetitive queries (eg fetching latest posts)

Request

Route

GET /v1/posts

Headers

Accept: application/json
Content-Type: application/json
Authorization: Bearer your_access_token
If-None-Match: "c923859fa465bfc3bca9597e08336fb2"
Host: api.producthunt.com

Response

Status

304 Not Modified

Headers

X-Frame-Options: SAMEORIGIN
X-XSS-Protection: 1; mode=block
X-Content-Type-Options: nosniff
X-Rate-Limit-Limit: 900
X-Rate-Limit-Remaining: 900
X-Rate-Limit-Reset: 900
ETag: "c923859fa465bfc3bca9597e08336fb2"
Cache-Control: max-age=0, private, must-revalidate