惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

量子位
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
F
Fortinet All Blogs
博客园 - 聂微东
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Hugging Face - Blog
Hugging Face - Blog
V
Visual Studio Blog
小众软件
小众软件
有赞技术团队
有赞技术团队
雷峰网
雷峰网
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
AWS News Blog
AWS News Blog
C
Cisco Blogs
美团技术团队
T
Threat Research - Cisco Blogs
C
CERT Recently Published Vulnerability Notes
人人都是产品经理
人人都是产品经理
宝玉的分享
宝玉的分享
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
酷 壳 – CoolShell
酷 壳 – CoolShell
Stack Overflow Blog
Stack Overflow Blog
W
WeLiveSecurity
D
DataBreaches.Net
博客园 - 司徒正美
Blog — PlanetScale
Blog — PlanetScale
IT之家
IT之家
云风的 BLOG
云风的 BLOG
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
Simon Willison's Weblog
Simon Willison's Weblog
Google DeepMind News
Google DeepMind News
T
The Blog of Author Tim Ferriss
Know Your Adversary
Know Your Adversary
NISL@THU
NISL@THU
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
The Cloudflare Blog
Vercel News
Vercel News
月光博客
月光博客
T
Tailwind CSS Blog
H
Help Net Security
aimingoo的专栏
aimingoo的专栏
P
Proofpoint News Feed
Application and Cybersecurity Blog
Application and Cybersecurity Blog
Spread Privacy
Spread Privacy
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
Cisco Talos Blog
Cisco Talos Blog
Microsoft Security Blog
Microsoft Security Blog
V
V2EX
WordPress大学
WordPress大学
Cyberwarzone
Cyberwarzone
Recent Announcements
Recent Announcements

ImageKit.io Blog

Next.js Image Optimization with ImageKit Use Video as a Background in Your Next.js Project How to Fix Autoplay Video in Next.js How Durian Scaled a Visual-First Retail Experience to 350K Monthly Visitors Online How Matsmart accelerated image delivery across countries with ImageKit AI in Digital Asset Management: From Smart Workflows to Agentic Automation How Joseph Joseph unified and secured global video delivery with ImageKit How Modall powers fast, effortless media delivery across 40+ projects with ImageKit Digital Asset Management (DAM) Trends: 2026 Report How to add a poster image to Video.js player (and automate it) HLS streaming with Video.js + React Building the future of storytelling with fast, AI-powered video delivery How PushOwl delivers 100M+ image-rich notifications seamlessly with ImageKit How Homify delivers millions of interior design images seamlessly with ImageKit Better event discovery with lightning‑fast videos & images Adding video player in React Native Video player in Angular applications Crop and resize videos in React Next.js image and video upload React image and video upload React video optimization How we quadrupled our traffic to 625K monthly page views How Apollo 24|7 boosted performance & reduced costs with ImageKit Simplify your media workflows with ImageKit DAM integrations Extending Lighthouse for custom image and video optimization analysis Brand Asset Management: What is it? How does it work? WordPress Digital Asset Management Guide - Manage your WP media assets better Why Shopify retailers need a digital asset management solution DAM vs. SharePoint: Which is best for you? AI-powered Metadata and Tagging in Digital Asset Management How Hopscotch built India's largest online Kids' fashion brand with ImageKit Dropbox Vs. DAM: Which Is The Right Tool For Digital Asset Management Digital Asset Management for Photographers: A Complete Guide Why digital asset management for agencies is essential Helping both Top and Bottom Line: SaffronStays rapid, profitable growth with ImageKit How KreditBee simplified media experiences with ImageKit Google Drive alternatives for businesses (with fast-growing teams) Node.js image upload ImageKit: The Secret Ingredient in Swiggy’s Expansion Journey Streamlining the Design Approval Process: A Comprehensive Guide AV1 Codec - Complete guide for video application devs PHP image and video upload Angular image & video upload AV1 vs VP9: Which codec should you choose? Adding video player in Next.js React Video Player VP8 vs VP9 - In the context of online video delivery Exploring WebM vs MP4 7 Free Digital Asset Management Software that are not Open-Source Comparing 9 Top Digital Asset Management Tools in the Market What are Brand Standards and Why do they Matter? Boost Sales and Brand Appeal: Essential Tips for eCommerce Image Management Brand Recall: The Strategy to Create Unforgettable Brands How to upload files in HTML? Branding for Small Businesses (2025 Edition) Everything you need to know about VP9 codec Recent updates from ImageKit and what's next Best Ways to Write RFP For Digital Asset Management (+ with free RFP template) What is Brand Dilution? How to Avoid It? Explained with [Examples] The Importance of Brand Identity: Leveraging Digital Asset Management for Impact From Launch to Scale: How to Launch a Brand Campaign Digital Asset Management Requirements - What do You Need to Evaluate and How? Marketing Collateral Management: A Quick End-to-End Guide Video Content Management System: What Is It And How To Choose One? Dropbox vs. Google Drive vs. Onedrive: The Best Cloud Storage Solution How to Build Brand Trust: Get Started In 2025 Google Drive vs. Box: A Detailed Comparison How Digital Asset Management Solutions Help Protect Brand Equity A DAM Solution Can Safeguard Your Digital Intellectual Property - Here’s How WebP Vs. PNG: Which Image Format Should You Use and Why? How to Resize Images in Bootstrap Easily Progressive jpegs (PJPEG): the key to loading images faster on your website Dropbox vs. Google Drive: The Best Cloud Storage For Digital Assets Dropbox Pros & Cons In 2024: An In-Depth Analysis and Why A DAM Solution Stands Out Google Drive Vs OneDrive: The Better Storage Option For Digital Assets Manage your video assets better with video metadata Understanding DAM's Role in Strengthening Brand Identity Digital asset management strategy: What to know before creating one The Ultimate Guide To Marketing Agency Onboarding 6 Solutions To Simplify Large File Sharing Over The Web A Step-by-Step Breakdown of a Video Production Workflow 13 Digital Asset Management Use Cases You Should Know How to Conduct a Brand Audit and Manage Your Brand Assets Costly Consequences of Inconsistent Branding And How DAM Can Help Dynamic Asset Transformation: What It Is, Why You Need It, and How ImageKit Can Help Everything You Need to Know About HTML Video Autoplay How To Select Your DAM Vendor: A Complete Guide How to Boost User Experience with Smart Digital Asset Management React Image Optimization: A Guide for Web Developers Why Should DAM Be A Part Of Your MarTech Stack? Unleashing the Power of Content Repurposing with ImageKit MKV vs MP4: Which Video File Format Is Better for Your Needs? Digital Asset Management For Ecommerce: A Complete Guide How an Image Tagging Software can Transform Your Image Search How to Manage Your Content Lifecycle Effectively M4V vs MP4: Which Video Format Should You Use and Why? Why Every Business Needs An Image Management System All The Questions To Ask During A Dam Demo Which is the Best Image Format for Your Website? Uploading Multiple Files Using JavaScript: A Comprehensive Guide
Optimize and resize images in DigitalOcean Spaces in real-time with ImageKit
Rahul Nanwani · 2021-07-28 · via ImageKit.io Blog

DigitalOcean is a relatively new cloud provider that has democratized and simplified the availability and deployment of cloud applications. DigitalOcean Spaces is one of the several products offered by DigitalOcean. It is an object storage in the cloud that helps you store your files in the cloud and provides an instant, high availability storage that can provide practically infinite scale.

DigitalOcean Spaces is a great, low-cost cloud storage for large objects like high-quality images. Despite that, it has some drawbacks -

  1. Spaces cannot optimize your images to the correct format like WebP or the even newer AVIF.
  2. It cannot compress your images and make them suitable for delivery on the web.
  3. It does not offer real-time image transformations on images, which means you will have to resize the images for every screen size on your own.
We will optimize this image with ImageKit
We will optimize this image with ImageKit

Since image optimization and transformation is essential to delivering a great user experience across devices, one cannot ignore these drawbacks. But, on the other hand, as a business, you might not have time, amongst all the other product features, to dedicate time and resources to image delivery.

This is where a solution like ImageKit comes in. It can integrate with your DigitalOcean Spaces storage and help you deliver perfectly optimized, responsive images across devices. And you can get started for free because ImageKit offers a generous forever free tier to all its users! Read on to see how you can do this.

What is ImageKit?

ImageKit is a cloud-based end-to-end image management and delivery service. It comes with its own storage and delivery CDN (AWS CloudFront), along with more than 50 image and video transformations that can be performed in real-time.

The best part about ImageKit is that it is not necessary to use ImageKit's storage to use its optimization and transformation features. It can be integrated with any external storage, including S3-compatible storage like DigitalOcean Spaces, to help you deliver lighter images in no time.

The same 2.5MB image shown above is optimized by ImageKit
The same 2.5MB image shown above is optimized by ImageKit

Over 35,000 developers and 600 companies use ImageKit to deliver billions of optimized images and videos every day. Let’s look at how you can use it with your DigitalOcean Spaces bucket. You can refer to the latest technical documentation of DO Spaces integration here.

Request flow for optimized images in DO Spaces with ImageKit

  1. After attaching your public or private Spaces storage to ImageKit, access the image in it using the ImageKit URL endpoint.
  2. If ImageKit has a cached version of its CDN or other internal caches, it delivers the image from there. Such images get delivered in low double-digit milliseconds.
  3. Suppose ImageKit does not have the optimized and transformed image in its cache. In that case, ImageKit gets the original image from your Spaces attached to ImageKit, does all the processing in real-time, and sends back the right image to the user. This takes about 100-200ms on average, depending on the input image.
  4. Subsequent requests for the same image get served from ImageKit’s CDN.
The request workflow with ImageKit and DigitalOcean Spaces storage attached to it
The request workflow with ImageKit and DigitalOcean Spaces storage attached to it

Let’s look at the steps you need to follow to optimize and resize the images in your DO Spaces storage via ImageKit.

We have created a new DO spaces storage for this article and uploaded a few images to it. The objects inside the storage are Private, but the steps remain the same even if the objects are Public.

Our DO Spaces storage with private objects in it
Our DO Spaces storage with private objects in it

By the end of this article, we would be able to deliver high-quality, responsive images across devices using the original image stored in this storage.

1. Create an ImageKit Account

The first step in this process is to create a free ImageKit account. ImageKit offers a fully-featured, forever free account with 20GB of delivery bandwidth every month. This is usually more than enough for websites up to a few thousand page views in a month.

ImageKit offers seven processing regions across the globe for optimization. You should choose the one that is geographically closest to your Spaces storage location.

2. Creating Access Keys for your DO Spaces storage

Since the images added to our DO Spaces are private, we cannot access them via the object's URL. We need to create a Spaces Access Key in DigitalOcean to be able to access the object.

Note: If the objects in your bucket are public, i.e., you can access them via their URL, you can also use ImageKit's Web Server origin to attach your DO Spaces to ImageKit. Read here

To create an access key, go to the Spaces home page, click on Manage Keys, and then click on Generate New Key.

You will need to give it a name, and once generated, you get an Access Key and a Secret Key. This is the only time that the secret will be displayed, so it is best to copy both the keys. We will need them to add this storage to ImageKit. You can also refer to DigitalOcean Space's documentation for doing the same.

We created a key called test-read-key for integrating our DO Spaces storage with ImageKit
We created a key called test-read-key for integrating our DO Spaces storage with ImageKit

Note: Ideally, every 3rd-party client that accesses your DO Spaces should have a separate key so that you can manage or revoke access to an individual client. So, even if you have an existing key, creating a new key for adding your storage to ImageKit is advisable.

3. Copying your Spaces Endpoint

DigitalOcean Spaces is a S3-compatible storage. This means that we can access it just like an AWS S3 storage, with the only difference being the Endpoint you provide to the AWS S3 API. Therefore, apart from the access keys that we created above, to integrate Spaces with ImageKit, you will need to copy the Endpoint for your storage.

You can find the URL Endpoint under the Settings tab of your storage.

4. Attaching your Spaces storage to ImageKit

The next step is to attach your Spaces storage to ImageKit. This will allow ImageKit to access the original images from your storage when needed.

To do this, go to “External Storage” in the ImageKit dashboard and click on the “Add New Origin” button. In the modal that opens up, select the “Origin Type" as “S3- Compatible Storage”.

You can now fill up all the other fields in this modal like the Bucket Name, Bucket Folder (the folder you want to access in the Spaces, we will use / because we want to be able to access the entire bucket. Add the Access Key, Secret Key, and the Endpoint (with http:// prefixed to what you copied in step 3) in the corresponding fields and click on Save.

DigitalOcean Spaces storage attached to ImageKit as an S3-compatible storage
DigitalOcean Spaces storage attached to ImageKit as an S3-compatible storage

Now head over to the “URL Endpoints” section in the ImageKit dashboard. Your newly added Spaces origin will appear under the Default URL Endpoint. If not, you can always click on Edit URL Endpoint and the Spaces origin to your ImageKit URL Endpoint.

That’s it! The setup is now complete.

We can start accessing the images in your DO Spaces storage via ImageKit. If you provided access to the entire storage (using Bucket Folder as /), you just need to replace the spaces URL endpoint with the ImageKit URL endpoint.

https://test-imagekit-spaces.sgp1.digitaloceanspaces.com/product-clothes-3.jpg

The DO Spaces object URL

gets changed to

https://ik.imagekit.io/ikmedia/product-clothes-3.jpg

URL using ImageKit URL endpoint

Automatic image optimization for Digital Ocean Spaces

ImageKit automatically converts the images to the correct format, like WebP or AVIF (if enabled on your account), and compresses it. The format conversion is done after determining the formats supported in the requesting browser and the original image's content. So you can be assured that ImageKit's automatic optimization will help you serve a correctly optimized image on all devices and browsers.

For example, the original image product-clothes-3.jpg in the storage was 2.5MB in size.

When you access it via ImageKit, the image is converted to WebP on a supported browser, and the size comes down to 1.2MB. That's over a 50% reduction in size without making any other change to the URL!

The same 2.5MB image shown above is optimized by ImageKit
The same 2.5MB image shown above is optimized by ImageKit

Real-time image resizing and other transformations for DO Spaces

ImageKit allows you to transform your images in real-time by specifying the right parameters in the URL. For example, if you have to resize the above image to width 300px, you just need to add tr=w-300 as a query parameter in your URL.

https://ik.imagekit.io/ikmedia/product-clothes-3.jpg?tr=w-300
Image resized to width 300px
Image resized to width 300px

And just like that, you get a 300px wide image in real-time.

Need a 300 x 400 image? It should not be a problem with ImageKit’s resizing parameters.

https://ik.imagekit.io/ikmedia/product-clothes-3.jpg?tr=w-300,h-400

Like the examples above, ImageKit offers over 40 different transformations, from simple cropping and resizing to more complex ones like watermarking, smart crop, blurring, background change, etc. You can use these transformations to deliver responsive images to your users, ensuring excellent performance across devices.

<img srcset="https://ik.imagekit.io/ikmedia/product-clothes-3.jpg?tr=w-300 300w,
	  https://ik.imagekit.io/ikmedia/product-clothes-3.jpg?tr=w-600 600w,
          https://ik.imagekit.io/ikmedia/product-clothes-3.jpg?tr=w-900 900w"
     sizes="(max-width: 480px) 300px, 50vw" />

Example of a responsive image tag

Or get creative and use the text overlays to build rich contextual images and dynamic banners for retargeting your users on social media and email.

Actual Image URL - Link
Actual Image URL - Link

Here is a video demonstrating some of the transformations available in ImageKit.

Examples of real-time image transformations with ImageKit

Improving Google Lighthouse score for images in DigitalOcean Spaces

With ImageKit, the images in your storage get automatically optimized to the right format, right compression level, and you get the flexibility to resize and transform them to the exact size needed on your UI. ImageKit also comes integrated with AWS CloudFront CDN, which reduces the load time and improves caching of the images. This helps you resolve any image-related issues thrown up by Lighthouse, PageSpeed, or any other web performance measurement tool.

A better score helps you improve your SEO rankings and the user experience you deliver to your customers.

Get started with ImageKit now!

ImageKit's Forever Free plan comes with all the necessary features for image optimizations and transformations for your DigitalOcean spaces storage. It provides you with 20GB of output bandwidth every month absolutely free.

Sign up now and start delivering perfectly optimized images on your websites and apps.