[00] Subset Sizes, User guide
ShortPixel
Last updated
How Subset Sizes hands sizes it makes on demand to ShortPixel Image Optimizer for compression, the ShortPixel setting it relies on, and the limits.
Subset Sizes works with ShortPixel Image Optimizer with nothing to set up on the Subset side. ShortPixel compresses the sizes made at upload as usual. Sizes made later, when a page first asks for them, are handed to ShortPixel at the end of that request, so they’re compressed too.
What works
- New sizes reach ShortPixel’s queue. Subset Sizes reports each new size through
shortpixel-thumbnails-regenerated, the hook ShortPixel listens to after thumbnails are regenerated. ShortPixel marks the size as not optimised yet and queues the image. - One hand-over per image. All the sizes one page view creates for an image are sent together at the end of the request. A bulk run sends them every 20 images, so a long WP-CLI regeneration doesn’t build up a large backlog.
- Only new files are sent. A size that already exists isn’t reported again.
- ShortPixel errors stay in ShortPixel. If the hand-over fails, the image is still served.
What needs a setting
ShortPixel queues the image only if it optimises new uploads automatically. That’s Optimize media on upload under Settings → ShortPixel → Processing, which is on by default (ShortPixel’s documentation (opens in a new tab)).
ShortPixel’s thumbnail exclusions still apply. A size you’ve excluded under Settings → ShortPixel → Exclusions isn’t compressed when Subset Sizes makes it (how to optimise only some thumbnail sizes (opens in a new tab)).
Known limits
- The first visitor gets the uncompressed file. ShortPixel compresses from its own queue after the request ends, so the size served on that first request is the one Subset Sizes saved.
- ShortPixel must be active on the request that makes the size. Subset Sizes checks that ShortPixel’s hook is registered and sends nothing when it isn’t.
- Each size counts towards your ShortPixel quota, the same as a thumbnail made at upload (ShortPixel on thumbnails (opens in a new tab)). With Lazy sizes on, sizes no page uses are never made, so they never use quota.