Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

iTechGuides is reader-supported. When you buy through links on our site, we may earn an affiliate commission. As an Amazon Associate I earn from qualifying purchases. Learn more

For private image thumbnails in Node.js, the best object storage is usually the service that fits your existing cloud environment: use Amazon S3 with presigned GET URLs in an AWS-based application, or Google Cloud Storage with V4 signed URLs in a Google Cloud application. If you need CDN delivery and additional access policies, consider CloudFront in front of S3. These are documentation-based architectural fits, not a measured ranking of price or performance.

What makes object storage suitable for private thumbnails?

Keep both the original image and its derived thumbnail private. After your application authenticates a user and confirms permission to view the image, it can create a temporary URL for the exact thumbnail object and return that URL to the authorized client. The storage service then grants access through the URL rather than making the object public. AWS describes presigned URLs as a way to grant time-limited access without changing the bucket policy: Amazon S3 presigned URLs.

A signed URL is a bearer credential: anyone who obtains it can use it for its allowed action while it remains valid. Google Cloud states that anyone possessing a signed URL can use it while active, even without a valid account: Google Cloud signed URLs. Treat the URL as a secret: avoid putting it in public logs, analytics events, or other locations accessible to unintended parties.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Signing a thumbnail URL does not create the thumbnail. Image resizing, format conversion, and thumbnail persistence are separate image-processing decisions; the storage documentation cited here does not establish or compare transformation features.

Which storage and delivery approach fits your application?

Approach Useful fit Important checks
Amazon S3 presigned GET Direct, time-limited access to private S3 objects in an AWS application. The URL can be reused until it expires. The signer must have permission for the requested object operation, and temporary credentials may expire before the URL’s configured expiration. AWS documentation.
CloudFront signed URL over S3 Private content delivered through a CDN when distribution and access policies are part of the design. Configure trusted key groups and signing keys. To prevent clients from bypassing CloudFront with direct S3 URLs, use origin access control and remove other S3 read permissions. CloudFront signed URLs and restricting access to an S3 origin.
Google Cloud Storage V4 signed URL Google Cloud workloads that need time-limited object access and a documented Node.js client-library pattern. Signed URLs use XML API endpoints. Configure signer authorization and the required credentials or signing setup. Google Cloud signed URLs.

Choose based on your existing cloud ecosystem, how the signing identity is managed, whether clients should access the object store directly or through a CDN, and whether direct access to the origin must be blocked. The cited provider documentation does not supply a comparable workload-specific price, latency, throughput, or thumbnail-transformation benchmark, so it cannot establish a universal winner.

How should a private-thumbnail request work?

  1. Authenticate the user. Establish the user’s identity in your application before granting access.
  2. Authorize the image request. Check that this user may view the requested image. Do not treat possession of an image ID or a client request as proof of entitlement.
  3. Resolve the thumbnail object. Select the exact private thumbnail key or object name on the server. Sign the derived thumbnail, not the original, when the client only needs the thumbnail.
  4. Create a temporary read URL. Use server-side credentials with permission to read that object, and set an expiration appropriate to the use case.
  5. Return the URL only to the authorized client. Keep signing authority and credentials on the server; do not expose them in browser code.

The user’s application authorization and the cloud identity used to sign are distinct. For S3, the URL exercises the signing principal’s permitted operation; it does not independently re-check your application’s user permissions each time the URL is used. Anyone holding the URL can use it until it expires or becomes invalid.

How do you create a signed URL in Node.js?

Google Cloud Storage V4 read URL

Google’s Node.js example uses the @google-cloud/storage client, Application Default Credentials, a read action, and an expiration timestamp. The following illustrates that signing pattern; it is not a complete user authorization system or image-processing pipeline.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
const { Storage } = require('@google-cloud/storage');

const storage = new Storage();

async function createThumbnailReadUrl(bucketName, objectName) {
  const expiresAt = Date.now() + 15 * 60 * 1000;
  const [url] = await storage
    .bucket(bucketName)
    .file(objectName)
    .getSignedUrl({
      version: 'v4',
      action: 'read',
      expires: expiresAt,
    });

  return url;
}

The 15-minute interval is an example expiration in Google’s sample, not a required setting or a comparative security recommendation. Set the expiry to suit your application and threat model. Google documents the Node.js V4 workflow here: Sign URLs with helpers. The identity creating the URL must have the necessary authorization and signing capability; configure credentials and signing support for your deployment rather than assuming the sample alone completes that setup.

Amazon S3 presigned GET

For S3, generate a presigned GET URL in server-side code using the AWS SDK and a principal allowed to read the target object. AWS documents that the signing principal’s credentials determine the operation the URL can perform and that the URL’s effective lifetime can be shorter than its configured expiry when the credentials expire or are revoked. Follow the current SDK workflow in AWS’s presigned URL documentation.

CloudFront signed URL

Use a CloudFront signed URL when the client should request content through a distribution and your access rules call for CloudFront policies, such as restrictions by IP range. Configure trusted key groups and signing keys, then restrict the S3 origin if direct S3 access must not be possible. CloudFront evaluates authorization on requests: an already-started download may finish after URL expiry, while a later range request after expiration fails. See CloudFront signed URL behavior.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

How long should a signed link last?

Use the shortest practical lifetime that still supports the client workflow. A shorter expiry reduces the period in which a leaked URL can be reused, but may require the application to issue another URL if the client needs the image later. S3’s effective URL lifetime is also bounded by the credentials used to sign it; temporary credentials may expire sooner, and revocation can invalidate access earlier. Google Cloud’s V4 Node.js example demonstrates a configurable expiration, including a 15-minute sample, rather than prescribing a universal duration.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Because a signed URL can be reused while valid, do not issue it until after the application has checked entitlement. If the user loses authorization after issuance, the URL’s bearer behavior means the storage request itself does not automatically repeat that application-level check.

What should you choose?

  • Already on AWS and need direct private-object reads: S3 presigned GET URLs are a straightforward fit.
  • Already on Google Cloud and need signed reads from Node.js: Cloud Storage’s V4 signed URL workflow is a documented fit.
  • Need CDN delivery or CloudFront access policies: Put CloudFront in front of S3 and restrict the origin if direct S3 access must be blocked.

These choices follow the providers’ documented capabilities. They do not establish which service is cheapest or fastest for a particular thumbnail workload.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.