简体   繁体   中英

AWS Cloudfront - and filenames upon deploying

I was wondering if it's possible to manipulate or change the names of files upon deploying the distribution.

Reason for during this, is that we don't have the actual files on our own servers but is provided by a partner. Is it somehow possible to run a php function upon deploy to change the name of the file on the cdn ?

So eg.

partner.example.com/image/123120913.jpg

to

1234.cloudfront.com/image/SHOE-NAME.jpg

One way is to import all images first to local storage and upon that download change filename - but seems very extensive.

As we can provide the image name easy if it's possible to run a php function upon deploying.

Amazon CloudFront is a caching service that retrieves content from a specified origin (eg web server, Amazon S3), stores it in a cache and then serves it to users.

Amazon CloudFront does not create aliases to filenames. It simply passes the request to the origin. If the origin is a web server, you could write a web app that returns any type of information given the request URL, but CloudFront cannot rename or map filenames.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM