Pixboost
  • Overview
  • Quickstart
  • Tools and Setup
    • Source Images
      • Adding Source Image Domain
      • Adding HTTP Image Source
      • Adding AWS S3 Bucket Image Source
    • Managing API Keys
    • Managing Users
    • Snippet Generator
    • Custom Domain Name
    • Cache Invalidation
    • HTTP/2 Support
    • HTTP/3 Support
  • API. URL-based integration
    • Resize
    • Fit
    • Optimise
    • As is
  • Using with React
  • Shopify Integration
  • Automated Workflows
    • Cache Invalidation
    • Warmup
    • API Secrets
  • Performance Testing
  • Open Source Version
Powered by GitBook
On this page
  • Description
  • Parameters
  • Response
  • Example
  • Limitations

Was this helpful?

  1. Automated Workflows

Warmup

PreviousCache InvalidationNextAPI Secrets

Last updated 1 year ago

Was this helpful?

API endpoint - POST /api/2/img/warmup?auth=[API_SECRET]

Description

/warmup performs transformations and caches them, so it will speed up the first response time from the real user.

The typical usecase is an application where the user can upload images by themselves, then see them once uploaded. The first render could take some time (1-4 seconds) and using /warmup will decrease the response time.

The below example will warm up caches for 2 variants of the image:

  • https://pixboost.com/api/2/img/http://www.midday.coffee/banner.jpeg/resize?size=x100&auth=ABCDEF

  • https://pixboost.com/api/2/img/http://www.midday.coffee/banner.jpeg/resize?fit=100x100\&auth=ABCDEF

The URLs of the images to warm up should be exact the same as you use in your front end implementation.

curl -X POST -H 'Content-Type: application/json' \ 
    'https://pixboost.com/api/2/img/warmup?auth=ABCDEF' \
    -d '{"images: ["https://pixboost.com/api/2/img/http://www.midday.coffee/banner.jpeg/resize?size=x100&auth=ABCDEF","https://pixboost.com/api/2/img/http://www.midday.coffee/banner.jpeg/resize?fit=100x100&auth=ABCDEF"]}'

Parameters

Response

202 - The warmup has been successfully initiated.

Example

Limitations

Maximum number of images to warmup in one call is 20. This is a soft limit and could be increased on request.

API_SECRET - .

You can find reference example of using cache invalidation workflow with S3 bucket . You can replace cache invalidation call with /warmup in Lambda.

secret key
here