Question

Does S3 CDN offer any cache mechanism similar to AWS's Cloudfront's Presigned Cookies?

I am using pre-signed url for frontend image display. However, each time the page is reloaded a new pre-signed url is generated from the backend. As each url to the same image is different, I am not sure if this is cache-friendly. In AWS’s CloudFront they have pre-signed-cookies. The URL will always be the same for the browser, and the permission is stored in the cookies. Does Digital Ocean have something similar? Or do I have to cache the pre-signed urls myself to avoid high bandwidth width? Thanks


Submit an answer


This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

DigitalOcean Spaces CDN doesn’t have a direct equivalent to AWS CloudFront’s pre-signed cookies, but you can still improve caching while using pre-signed URLs.

The main issue is that every time a new pre-signed URL is generated, browsers and caches treat it as a completely new file, preventing efficient caching.

One option is to use a fixed URL with longer expiration times instead of generating a new pre-signed URL on every request. If the images don’t change frequently, setting a longer expiration time for the signed URL can allow browsers to cache it properly. Another important step is configuring Cache-Control headers correctly. If your assets are static, using Cache-Control: public, max-age=31536000, immutable will allow the browser to cache the file long-term without checking for updates.

If you need more control, you can implement a caching mechanism in your backend, storing valid pre-signed URLs in memory (e.g., using Redis) and serving the same URL to users within a given timeframe.

Become a contributor for community

Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.

DigitalOcean Documentation

Full documentation for every DigitalOcean product.

Resources for startups and SMBs

The Wave has everything you need to know about building a business, from raising funding to marketing your product.

Get our newsletter

Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.

New accounts only. By submitting your email you agree to our Privacy Policy

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.