Skip to content

Optionally cut parameters from image URL #89

Open
@ofhouse

Description

@ofhouse

When providing the URL the user could add parameters to the URL to pass the CloudFront cache key.
E.g.: /_next/image?url=http%3A%2F%2Fexample.com%2Ftest.png%3Ffoo%3Dbar

There should be an option to prevent bypassing the cache this way.

url parameter

This is a tricky one since adding parameters to the the url is a valid option since it could be used with storage engines that require some form of authentication. E.g. adding a api key through a parameter.

The only way to secure this would probably to introduce another S3 bucket instead of (or together with) CloudFront Origin Shield for the local caching.
This way the CloudFront Function could from the Accept header could determine a cache key (leaving out path params) based on the input and forward the request to S3.
If an object with the key exists in S3 it is served from there otherwise a failover would trigger the Lambda to generate a response or image.
The Lambda would then determine a cache-key based on the input params and store the image back to S3 before returning it to CloudFront.

x-ref: #75

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy