Important note

The EdgeRules feature is available only on Enterprise plans.

  1. Background

    Keeping dynamic content from being pulled from the CDN can be important, especially when you have a full site cache configured and you want to make sure that the CDN will not be a part of dynamic content execution and/or delivery. Why is this important? When dynamic content is requested from the CDN we will try 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 getting your site fully loaded.

    The rule below takes all requests for PHP files and pushes them directly to the origin server for execution:

  2. Curl Showing Effect Of This Rule

          curl -I
          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
          Server: NetDNA-cache/2.2
  3. Resulting Nginx Configuration Block

           location ~ \.(php)$ {
                    set $origin;
                    rewrite ^ $origin$request_uri permanent;