Enclosure

What is Enclosure?

The enclosure tag is the critical RSS element that tells podcast apps where to download your audio file. It's what transforms a standard RSS feed into a podcast feed capable of delivering media content.

Enclosure Tag Anatomy

Every enclosure tag requires three attributes:

<enclosure
  url="https://cdn.example.com/episodes/ep001.mp3"
  length="48576000"
  type="audio/mpeg"
/>
Attribute Purpose Example
url Direct link to audio file https://cdn.example.com/ep001.mp3
length File size in bytes 48576000 (≈46MB)
type MIME type of the file audio/mpeg for MP3

Common MIME Types

Format MIME Type Usage
MP3 audio/mpeg Most common, universal support
M4A/AAC audio/x-m4a Apple devices, smaller files
OGG audio/ogg Open source alternative

Technical Requirements

URL requirements:

  • Must be a direct link to the file (not a redirect chain)
  • Should use HTTPS for security
  • Must be publicly accessible (no authentication)
  • Should be served from a CDN for reliability

File size accuracy: The length attribute must match the actual file size in bytes. Incorrect values can cause:

  • Download progress bars to display incorrectly
  • Some apps to reject the episode entirely
  • Streaming issues on certain players

Why MP3 dominates: While other formats exist, MP3 remains the standard because:

  • 100% compatibility with all podcast apps
  • Well-understood bitrate and quality tradeoffs
  • Supports embedded ID3 tags for metadata

Why It Matters

The enclosure tag is quite literally what makes podcasting possible. If your RSS feed is the map, the enclosure is the treasure location—without it, apps have no way to download your audio.

Why enclosure correctness matters:

  1. Download failures: A malformed enclosure URL means zero downloads for that episode. Apps simply can't find your audio.

  2. Validation errors: Podcast directories reject feeds with invalid enclosures, potentially delisting your show.

  3. Playback issues: Wrong file sizes cause streaming problems and inaccurate progress indicators.

  4. Analytics accuracy: Since downloads are measured at the enclosure URL, incorrect URLs break your metrics.

Common enclosure problems:

Issue Symptom Cause
404 errors Episode won't download File moved or deleted
Wrong MIME type Some apps won't play Incorrect type attribute
Authentication required Download fails silently URL behind login
HTTP instead of HTTPS Security warnings Unencrypted URL

Most podcast hosting platforms handle enclosure generation automatically, but understanding the tag helps you debug distribution issues when they arise.

How to Use This in Dispatch

Enclosure tags are automatically generated with verified accuracy when you upload episode audio:

Automatic handling:

  • Correct URL pointing to our CDN
  • Precise file size calculated from your upload
  • Proper MIME type based on audio format
  • HTTPS encryption for all URLs

What you don't need to worry about:

  • File size calculations
  • URL formatting
  • MIME type detection
  • CDN distribution

Replacing episode audio: If you upload a replacement audio file, the enclosure automatically updates with the new URL and file size. The GUID remains unchanged to prevent duplicate downloads.

More from RSS Basics