aboutsummaryrefslogtreecommitdiffstats
path: root/guides/source/asset_pipeline.md
diff options
context:
space:
mode:
authorschneems <richard.schneeman@gmail.com>2014-08-24 15:42:39 -0500
committerschneems <richard.schneeman@gmail.com>2014-08-24 15:42:39 -0500
commit053dd0075c35a3f5a5dd67d68028d9e18886b738 (patch)
tree4b357767e518ca88360d03a3f49c1f5628e05f91 /guides/source/asset_pipeline.md
parentd736e9e4ac7fd72749626d67f3a8c27d6e46d2bc (diff)
downloadrails-053dd0075c35a3f5a5dd67d68028d9e18886b738.tar.gz
rails-053dd0075c35a3f5a5dd67d68028d9e18886b738.tar.bz2
rails-053dd0075c35a3f5a5dd67d68028d9e18886b738.zip
[ci skip] docs CDN caching behavior
Diffstat (limited to 'guides/source/asset_pipeline.md')
-rw-r--r--guides/source/asset_pipeline.md17
1 files changed, 17 insertions, 0 deletions
diff --git a/guides/source/asset_pipeline.md b/guides/source/asset_pipeline.md
index 0db570a46c..9a22ec5700 100644
--- a/guides/source/asset_pipeline.md
+++ b/guides/source/asset_pipeline.md
@@ -1005,6 +1005,23 @@ option your asset helper, which overwrites value set in
<%= asset_path 'image.png', host: 'mycdnsubdomain.fictional-cdn.com' %>
```
+#### Customize CDN Caching Behavior
+
+A CDN works by caching content. If the CDN has stale or bad content, then it is
+hurting rather than helping your application. The purpose of this section is to
+describe general caching behavior of most CDNs, your specific provider may
+behave slightly differently.
+
+##### CDN Request Caching
+
+While a CDN is described as being good for caching assets, in reality caches the
+entire request. This includes the body of the asset as well as any headers. The
+most important one being `Cache-Control` which tells the CDN (and web browsers)
+how to cache contents. This means that if someone requests an asset that does
+not exist `/assets/i-dont-exist.png` and your Rails application returns a 404,
+then your CDN will likely cache the 404 page if a valid `Cache-Control` header
+is present.
+
Customizing the Pipeline
------------------------