How to Use Vultr CDN to Enable Global Caching for Object Storage

Updated on February 1, 2024

Introduction

Vultr Object Storage provides a secure, scalable, and cost-effective solution for seamless data management and retrieval, making it a go-to choice for developers and businesses of all sizes. You can combine object storage buckets with Vultr CDN to cache all objects globally to improve the availability and reduce latency.

This article explains how to use Vultr CDN to enable Global Caching for Object Storage. You will set up a new bucket to store static files and deliver the files using your Vultr CDN URL instead of the object storage URL.

Prerequisites

Before you begin:

Note
This article uses the example files image1.png and downloadfile.zip. Replace the files with your actual values and valid read permissions for All Users to avoid file not found or AccessDenied errors.

Set Up Vultr Object Storage Bucket Files

Create a new Vultr CDN

  1. Open the Vultr Customer Portal.

  2. Navigate to CDN under the Products category.

  3. Click Add CDN to set up a new Vultr CDN endpoint.

  4. Enter your Vultr Object Storage URL in the Origin URL field using the following format:

    https://{BUCKET_NAME}.{REGION}.vultrobjects.com

    For example:

    https://webfiles.ewr1.vultrobjects.com
  5. Scroll and select any additional features to enable on the CDN endpoint.

  6. Click Create CDN to activate your CDN endpoint.

  7. When the deployment is successful, click the Edit icon Manage CDN next to the CDN resource to open the control panel.

  8. View your CDN Information in the Overview tab and verify that the Origin URL correctly points to your Vultr Object Storage bucket URL.

    View the Vultr Object Storage CDN Information

  9. Copy the generated Vultr CDN URL to use for accessing your accelerated objects.

Test

  1. Access your Vultr CDN endpoint using a web browser such as Firefox.

    https://cdn-example88.vultrcdn.com
  2. Verify that an XML Access Denied prompt displays in your web browser to represent the root bucket directory.

  3. Append your Vultr CDN URL with a valid image file available in the bucket. For example image1.png.

    https://cdn-example88.vultrcdn.com/image1.png
  4. Verify that the file displays correctly in your web browser.

  5. Append your Vultr CDN URL with a non-viewable, but downloadable file available in the bucket. For example, downloadfile.zip.

    https://cdn-example88.vultrcdn.com/downloadfile.zip

    Download a sample file from the Vultr CDN URL

  6. Verify that the file auto-downloads to your computer. Open your web browser downloads page and verify that the download source URL points to your Vultr CDN endpoint.

Conclusion

You have enabled global caching for object storage using Vultr CDN. Depending on the objects available in your target object storage bucket, you can cache the static assets to multiple locations around the world depending on your Vultr CDN configuration. For more information, visit the Vultr CDN documentation.