CDN for Ruby on Rails

Cache Rails sprockets/Propshaft assets, Active Storage public files and shareable pages with Aptranet Cloud CDN.

210+Points of presence worldwide
200+ TbpsNetwork capacity
30 msAverage latency worldwide
85%Average cache hit ratio

CDN for Ruby on Rails

Let Rails run the app. Let Cloud CDN run the assets.

Rails clusters should not spend Puma or Sidekiq-adjacent capacity serving digested assets and public blobs to every region.

Set asset_host to Cloud CDN. Cache public Active Storage URLs. Cache anonymous pages where possible. Bypass session views and POST.

Why teams use Aptranet

What CDN for Ruby on Rails looks like on this network.

Cloud CDN caches and accelerates eligible content on 210+ points of presence, with Origin Shield when the origin must stay out of the way.

Digested assets at the edge

Propshaft or sprockets files are cached on 210+ PoPs.

Public blobs worldwide

Active Storage public variants can be cached and transformed at the edge.

Session views stay in Rails

Devise, dashboards and CSRF forms are not cached.

How to set it up

A cutover you can validate before DNS moves.

Create the Cloud CDN configuration, prove it on an Aptranet hostname, then point production DNS when the path looks correct.

  1. 1
    Set config.asset_host

    Point digested assets at the Cloud CDN hostname.

  2. 2
    Cache public storage

    Put public Active Storage URLs on the same distribution or a media hostname.

  3. 3
    Optionally cache public HTML

    Marketing pages can be cached with purge on deploy.

  4. 4
    Bypass authenticated Rails

    Keep session cookies out of the cache key for app HTML.

Outcomes

What changes once the hostname is on Aptranet.

  • Rails assets are delivered globally
  • Public storage is cached at the edge
  • Session HTML remains dynamic
  • Puma spends less time on static files

Frequently Asked Questions

Yes. Both emit digest filenames that Cloud CDN can long-cache.

Fragment cache remains in Rails. Cloud CDN caches full anonymous responses you mark as public.

Keep private blobs on signed origin URLs. Cache public blobs only.

Cache full documents that are shareable. Turbo Drive requests that vary on session should bypass cache.

Put CDN for Ruby on Rails on the Aptranet edge.

Get started in the Management Console, or talk through origin, DNS and cutover with Aptranet.