Keeping dynamic content from being pulled from the CDN can be important, especially when a full site cache is configured, and we want to make sure that the CDN will not be a part of dynamic content execution or delivery. Why is this important? When dynamic content is requested from the CDN an attempt will be made to serve it, but since dynamic content can't be cached, the CDN will fail to deliver and execute. Because of this, extra time is spent loading the site in its entirety.
The EdgeRules feature is available only on Enterprise plans.
Creating the Rule
The rule below takes all requests for PHP
files and pushes them directly to the origin server for execution:
Verifying the Rule
Curl Showing Effect Of This Rule
curl -I http://foo.bar.netdna-cdn.com/login.php
HTTP/1.1 301 Moved Permanently
Date: Sun, 26 Jan 2014 17:30:20 GMT
Content-Type: text/html
Content-Length: 185
Connection: keep-alive
Location: http://www.origin.com/login.php
Server: NetDNA-cache/2.2
Resulting Nginx Configuration Block
location ~ \.(php)$ {
set $origin http://www.origin.com;
rewrite ^ $origin$request_uri permanent;
...
}
We hope this article was helpful and as always, If there are any questions or concerns about any of the topics mentioned in this article, please feel free to reach out to support - we are available 24/7 by chat or email!