File tree Expand file tree Collapse file tree 1 file changed +7
-11
lines changed Expand file tree Collapse file tree 1 file changed +7
-11
lines changed Original file line number Diff line number Diff line change @@ -865,23 +865,19 @@ config.asset_host = ENV['CDN_HOST']
865
865
NOTE: You would need to set ` CDN_HOST` on your server to ` mycdnsubdomain
866
866
.fictional-cdn.com` for this to work.
867
867
868
- Once you have configured your server and your CDN when you serve a webpage that
869
- has an asset :
868
+ Once you have configured your server and your CDN , asset paths from helpers such
869
+ as :
870
870
871
871
` ` ` erb
872
872
<%= asset_path('smile.png') %>
873
873
` ` `
874
874
875
- Instead of returning a path such as ` / assets/smile.png` (digests are left out
876
- for readability). The URL generated will have the full path to your CDN .
875
+ Will be rendered as full CDN URLs like ` http://mycdnsubdomain.fictional-cdn.com/ assets/smile.png`
876
+ (digest omitted for readability).
877
877
878
- ```
879
- http://mycdnsubdomain.fictional-cdn.com/assets/smile.png
880
- ```
881
-
882
- If the CDN has a copy of `smile.png` it will serve it to the browser and your
883
- server doesn't even know it was requested. If the CDN does not have a copy it
884
- will try to find it at the "origin" `example.com/assets/smile.png` and then store
878
+ If the CDN has a copy of ` smile.png` , it will serve it to the browser, and your
879
+ server doesn' t even know it was requested. If the CDN does not have a copy, it
880
+ will try to find it at the "origin" `example.com/assets/smile.png`, and then store
885
881
it for future use.
886
882
887
883
If you want to serve only some assets from your CDN, you can use custom `:host`
You can’t perform that action at this time.
0 commit comments