Skip to main content

How to Enable Etags

Updated today

The information below is intended for users who can also make changes to their webservers. Feel free to forward this article along to that person if you can't make the changes yourself, no login is necessary to see these help files. Also, the information below is intended to simply point you in the correct direction for getting ETags enabled on your server or service.

article for details.

Apache

ETags are enabled by default. What the ETag is based on can be modified (see Apache documentation). This example bases the ETag on last modified date (MTime) and file size (Size).

# httpd.conf, vhost, or .htaccess 
# Safer for multi-server: no inode
FileETag MTime Size

nginx

Etags are enabled by default (see nginx documentation). Example config:

http {
etag on;
# ...
}

Lighttpd

Enabled by default (see LIghttpd documentation).

etag.use-inode = "disable"  # disable if behind multiple hosts 
etag.use-mtime = "enable"
etag.use-size = "enable"
static-file.etags = "enable"

IIS (Windows)

ETags are on by default (see IIS documentation)

In IIS Manager → site → Configuration Editor → system.webServer/staticContent → ensure clientCache setEtag is True.

web.config example:

<configuration>
<system.webServer>
<staticContent>
<clientCache setEtag="true" />
</staticContent>
</system.webServer>
</configuration>

WordPress

Does not handle/send ETags natively. It relies on the webserver config (Apache/Nginx/etc) or a caching plugin.

WordPress caching plugins:

Drupal

Drupal 8+ uses the Cache API. ETags are automatically added to headers when page_cache and dynamic_page_cache modules are enabled

In the Drupal admin UI:

  • Extend → Core → Page Cache → Enable

  • Extend → Core → Dynamic Page Cache → Enable

Cloudflare

Cloudflare does not generate the ETags. It passes through or modifies the ones from your origin server. If you send an ETag header from your server, Cloudflare can cache it and serve it.

To preserve or respect ETags: In the Cloudflare Dashboard:

  • Go to Caching → Cache Rules → Create Rule.

  • Set the match (e.g. .example.com/static/).

  • Under “Settings,” turn Respect Strong ETags = ON. Example (via API/JSON):

{  "action": "cache",
"action_parameters": {
"respect_strong_etags": true
}
}

Cloudfront

Cloudfront passes or strips the ETags, based on the cache behavior and origin configuration.

  • If the origin includes ETag, CloudFront caches and returns it with the object.

  • It doesn’t validate conditional requests using ETag itself; it just stores the header.

  • You can use AWS WAF or Lambda@Edge to customize ETag behavior.

To ensure ETags are properly passed through:

  • Origin must send ETag (e.g., your S3 bucket or web server). • S3 adds ETag automatically when objects are uploaded.

  • Ensure your cache behavior allows it:

    • In the CloudFront console → Behaviors → Edit, under Headers, choose:

    • Whitelist Headers → ETag (for legacy behaviors)

    • or in the new console: add ETag to the Cache key and origin request policy.

If CloudFront compresses or re-encodes assets (Gzip/Brotli), ETags can change or become weak.

Akamai

Caches and passes ETags by default. Ensure "Honor Origin Cache-Control and ETag" is enabled in your Property configuration.

Fastly

Forwards the ETags from the origin server automatically.

Verify ETags

curl -I https://example.com/page.html   # look for ETag ('abc123') 
curl -I -H 'If-None-Match: "abc123"' https://example.com/page.html # expect 304 if matches


If you have questions, please reach out to our DubBot Support team via email at help@dubbot.com or via the blue chat bubble in the lower right corner of your screen. We are here to help!

Did this answer your question?