0Pricing
Supabase Backend as a Service · レッスン

画像変換と署名付きURL

画像をその場でリサイズ・最適化して配信し、Supabase Storageの署名付きURLを使って非公開ファイルへの一時的なアクセスを許可します。

「画像変換と署名付きURL」はCoddyKit上の無料Supabase Backend as a Serviceレッスンです。 これはレッスン4/4です。 下記で完全なレッスンを無料で読むことができます。その後、ブラウザ内の組み込みコードエディタと24時間対応のAIチューターでハンズオン演習できます。 これはSupabase Backend as a Service学習パスの一部であり、ウェブとCoddyKitアプリ全体で進捗が同期されます。 Supabase Backend as a Serviceコースには全4レッスンが含まれています。

このレッスンの一部はまだ翻訳されておらず、英語で表示されています。

Smarter File Delivery

Supabase Storage can transform images on request and create signed URLs for time-limited access to private files. Both reduce custom backend work.

Public vs Private Buckets

Public buckets serve files via a permanent URL. Private buckets require a signed URL or an authenticated request, controlled by policies.

Getting a Public URL

For public buckets, build the URL directly, no token needed.

const { data } = supabase.storage
  .from('avatars')
  .getPublicUrl('user-42.png');
console.log(data.publicUrl);

On-the-Fly Resizing

Pass transform options to request a resized version. Supabase generates and caches it.

const { data } = supabase.storage
  .from('avatars')
  .getPublicUrl('user-42.png', {
    transform: { width: 100, height: 100, resize: 'cover' }
  });

Why Transform at the Edge?

Serving a 100px thumbnail instead of a full-size photo saves bandwidth and speeds up pages, without storing many copies yourself.

Quality and Format

You can also tune quality and request modern formats to shrink payloads further.

function thumbOpts(size) {
  return { width: size, height: size, quality: 75, resize: 'cover' };
}
console.log(thumbOpts(64));

Creating a Signed URL

For private files, generate a URL that expires after a set number of seconds.

const { data } = await supabase.storage
  .from('invoices')
  .createSignedUrl('inv-2026.pdf', 60);
console.log(data.signedUrl);

Choosing an Expiry

Keep expiry as short as the use case allows. A download link might need 60 seconds; an embedded image might need an hour.

function expirySeconds(useCase) {
  return useCase === 'download' ? 60 : 3600;
}
console.log(expirySeconds('download'));

Signed URLs With Transforms

You can combine a signed URL with an image transform to serve resized private images securely.

Caching Behavior

Transformed images are cached at the edge, so repeated requests for the same size are fast. Vary the size sparingly to keep cache hits high.

Putting It Together

Use public URLs and transforms for open assets, and signed URLs for private files, with short expiries and edge caching for performance.

Quick Check

Test your understanding of URLs and transforms.

Recap

You learned to build public URLs, apply on-the-fly image transforms for performance, and create expiring signed URLs for private files, plus how edge caching keeps it fast.

よくある質問

「画像変換と署名付きURL」レッスンは無料ですか?

はい。「画像変換と署名付きURL」の完全なテキストはこのウェブで無料で読めます。インタラクティブに演習し(組み込みコードエディタと24時間対応のAIチューター)、Supabase Backend as a Serviceコースの残りをアンロックするには、CoddyKit PROにアップグレードしてください。 Supabase Backend as a Serviceコースには全4レッスンが含まれています。

「画像変換と署名付きURL」で何を学びますか?

画像をその場でリサイズ・最適化して配信し、Supabase Storageの署名付きURLを使って非公開ファイルへの一時的なアクセスを許可します。 ブラウザで直接実行するハンズオンコードでSupabase Backend as a Serviceを演習し、24時間対応のAIチューターがレッスンを進める中での質問に答えます。

Supabase Backend as a Serviceを始めるのに経験は必要ですか?

事前経験は必要ありません。CoddyKitのSupabase Backend as a Serviceは初級者から上級者向けに構成されているため、ここから始めるか最初から始めて、自分のペースで進むことができます。 これはレッスン4/4です。

「画像変換と署名付きURL」レッスンにはどのくらい時間がかかりますか?

ほとんどのCoddyKitレッスンは約5~10分かかります。各レッスンはコンパクトでインタラクティブなので、着実に進歩し、ウェブとアプリ全体で正確に前回の場所から再開できます。

このSupabase Backend as a Serviceレッスンでコードを書いて実行できますか?

はい。すべてのSupabase Backend as a Serviceレッスンに組み込みコードエディタが含まれているため、ブラウザでリアルコードを書いて実行し、即座のAIフィードバックを取得できます。ローカル設定は不要です。

このコースのすべてのレッスン

  1. Supabaseバケットへのファイル保存
  2. ポリシーによるアクセス管理
  3. メディアのアップロードと取得
  4. 画像変換と署名付きURL
← Supabase Backend as a Serviceに戻る