Tigris Image Optimization

tigrisdata/skills/skills/tigris-image-optimization

by tigrisdata668ea424758eNo license2 starsListed Oct 8, 2026Updated Oct 8, 2026Repository updated 2 months ago

Use when resizing images, generating thumbnails, serving responsive images, or optimizing image delivery with Tigris — covers Next.js, Remix, Rails, Django, Laravel, Express

AI-generated overview

Guides image resizing, thumbnails and responsive delivery for images stored in Tigris across six web frameworks.

What it does
This skill provides guidance for resizing, cropping and optimizing images stored in Tigris object storage. It compares upload-time, request-time and client-side processing strategies, describes storing size variants as separate objects, and covers CDN delivery through public buckets with cache header advice. Framework-specific instructions are delegated to resource files for Next.js, Remix, Express, Rails, Django and Laravel.
When to use it
Use it when generating thumbnails or fixed image variants, serving responsive images, or improving image delivery performance for an application backed by Tigris storage. It is also relevant when choosing between processing images at upload time versus on request.
Requirements
No scripts are included; it is instructions only. It assumes a Tigris account and bucket access, and the framework guides reference libraries such as Sharp, Multer, Active Storage, django-imagekit with Pillow, and Intervention Image. Network access is needed for CDN delivery and the linked documentation.

Tigris Image Optimization

Resize, crop, and optimize images stored in Tigris. Generate thumbnails on upload, serve responsive images, and leverage Tigris's global CDN for fast delivery.

Strategy Overview

ApproachWhen to UseProsCons
Process on uploadThumbnails, fixed sizesFast serving, predictableStorage cost per variant
Process on requestMany size variationsFlexible, less storageLatency on first request
Client-side resizeBefore uploadSaves bandwidth, fast uploadLess control over quality

Recommended: Process on upload for known sizes (avatar, thumbnail, cover). Use public buckets for CDN delivery — Tigris serves public files from the nearest global edge automatically.


Upload-Time Processing (General Pattern)

Generate variants when a file is uploaded, store each variant as a separate object:

avatars/user-123.jpg          # originalavatars/user-123-thumb.jpg    # 100x100avatars/user-123-medium.jpg   # 400x400avatars/user-123-large.jpg    # 800x800

Use access: "public" for images that need fast, CDN-backed delivery.


Framework Guides

Read the resource file for your framework:

  • Next.js — Read ./resources/nextjs.md for next/image config and Sharp processing
  • Remix — Read ./resources/remix.md for Sharp in action functions and responsive srcset
  • Express — Read ./resources/express.md for Sharp middleware with Multer
  • Rails — Read ./resources/rails.md for Active Storage variants
  • Django — Read ./resources/django.md for django-imagekit and Pillow processing
  • Laravel — Read ./resources/laravel.md for Intervention Image

CDN Delivery

Tigris public buckets serve files from the nearest global edge — no separate CDN setup needed.

Cache headers for images:

typescript
await put("images/hero.jpg", buffer, {  access: "public",  contentType: "image/jpeg",});

For immutable content-hashed filenames (e.g., hero-abc123.jpg), use long cache times. For mutable paths, use shorter TTLs or ETags.


Critical Rules

Always: Use access: "public" for images served to users (enables CDN) | Generate thumbnails at upload time for known sizes | Use WebP/AVIF for smaller file sizes | Set explicit contentType

Never: Process images on every request without caching | Store only originals if you always serve thumbnails | Resize in the browser after downloading full-size images


Related Skills

  • tigris-file-uploads — Full upload patterns per framework
  • tigris-egress-optimizer — Reduce bandwidth costs from image serving

Official Documentation

Source and attribution

Source:tigrisdata/skillsinskills/tigris-image-optimizationat commit668ea42

License: No license

Content belongs to its original authors. SourceWeft indexes it from a public repository.

Report or request removal