How to Use Vultr CDN Pull Zones with Object Storage to Enable Global Caching

Updated on November 13, 2024

Introduction

Vultr Object Storage is an S3-compatible service that enables the storage and delivery of files as objects. Vultr Object Storage buckets are compatible with reverse DNS which ensures access to objects using a bucket name and your object storage URL. Vultr CDN is a content delivery service that automatically caches static assets to multiple regions to enable fast delivery and distribution of assets. You can integrate your existing Vultr Object Storage bucket with a Vultr CDN pull zone and cache all available assets to improve the availability, distribution and delivery of objects.

This article explains how to use Vultr CDN pull zones with object storage to enable global caching. You will create a new Vultr Object Storage bucket, upload files, and enable the delivery objects using your Vultr CDN URL.

Prerequisites

Before you begin:

  • Deploy a Vultr Object Storage instance.

  • Create a new bucket. For example, webfiles.

  • Upload sample files to the bucket using an S3 Client such as Cyberduck, S3cmd, or S3 Browser.

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

    Set Up Vultr Object Storage Bucket Files

Create a Vultr CDN Pull Zone Using your Object Storage URL

Vultr CDN Pull Zones automatically cache objects from your origin URL for delivery using your CDN URL. Follow the steps below to create a new pull zone using your Vultr Object Storage bucket URL as the origin URL.

  1. Open the Vultr Customer Portal.

  2. Click Products on the main navigation menu and click CDN.

  3. Select Pull Zones from the list of options.

  4. Click Add CDN Pull Zone to set up a new pull zone.

    Create a new Vultr CDN Pull Zone

  5. Enter a new descriptive name in the Label to identify your pull zone subscription. For example, object-storage-cdn.

  6. Enter your reverse DNS Vultr Object Storage bucket URL in the Origin URL field using the following format:

    https://[Bucket Name].[Vultr Object Storage URL]

    For example:

    https://webfiles.ewr1.vultrobjects.com/
  7. Select additional features to enable on your Vultr CDN URL. For example, gzip.

    Create a new Vultr CDN

  8. Click Add CDN Pull Zone to create your new Vultr CDN Pull Zone.

  9. Verify that your new Vultr CDN Pull Zone is created and available on your CDN Pull Zones list.

    View created Vultr CDN Pull Zones

  10. Click your pull zone's CDN Domain field to open its management page.

  11. Find CDN Information within your Overview tab and verify that the Origin URL value correctly points to your Vultr Object Storage bucket URL.

    View the Vultr Object Storage CDN Information

  12. Copy your CDN URL value to use when accessing your cached objects. For example, https://cdn-example88.vultrcdn.com.

Test

Vultr Object Storage bucket contents are accessible using your reverse DNS URL that uses the bucket name and object storage URL. Your Vultr CDN Pull Zone automatically pulls the latest bucket contents for delivery using your Vultr CDN URL. Follow the steps below to access your cached Vultr Object Storage objects using your Vultr CDN URL.

  1. Access your Vultr Object Storage's management page.

  2. Navigate to Buckets and open your webfiles bucket to view the available objects.

  3. Verify all objects available in your bucket such as image1.png and downloadfile.zip.

    View Vultr Object Storage bucket objects

  4. Access your Vultr CDN URL using a web browser such as Firefox.

    https://cdn.example88.vultrcdn.com
  5. Verify that an XML Access Denied message displays in your web browser to verify that you have reached your Vultr Object Storage's root bucket directory.

    Verify the XML Object Storage error message

  6. Add a valid object name available in your bucket to your Vultr CDN URL. For example, downloadfile.zip and verify that the object is accessible depending on your permission configurations.

    https://cdn.example88.vultrcdn.com/image1.png

    Download a sample file from the Vultr CDN URL

Conclusion

You have used Vultr CDN Pull Zones with Vultr Object Storage to enable global caching of objects with a Vultr CDN URL. You can set up a new domain CNAME record that points to your Vultr CDN URL to securely deliver cached objects to multiple regions depending on the Vultr locations enabled in your pull zone configuration. For more information, please visit the Vultr CDN documentation.