Jump to content

Search the Community

Showing results for tags 'cloudflare cache cache-control document'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Welcome to ProcessWire
    • News & Announcements
    • Showcase
    • Wishlist & Roadmap
  • Community Support
    • Getting Started
    • Tutorials
    • FAQs
    • General Support
    • API & Templates
    • Modules/Plugins
    • Themes and Profiles
    • Multi-Language Support
    • Security
    • Jobs
  • Off Topic
    • Pub
    • Dev Talk

Product Groups

  • Form Builder
  • ProFields
  • ProCache
  • ProMailer
  • Login Register Pro
  • ProDrafts
  • ListerPro
  • ProDevTools
  • Likes
  • Custom Development

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests

Found 1 result

  1. Because of some server issues, and page loading speed and performance, I've been using Cloudflare to set up "cache everything" page rules for various sites. Cloudflare, by default, only caches assets like css or jpgs, but not the actual document html that is created by the server on request. Setting "cache everything" changes that and allows Cloudflare to serve up the html directly (rules providing). This cuts down the initial TTFB (time to first byte) considerably, especially during high traffic or server attacks. In order to tell whether Cloudflare is serving up an asset or not, you need to inspect the headers (break out your html inspectors and look at the network tab). In the response for the asset (jpg, css, document, etc) you'll see an attribute for "CF-CACHE-STATUS" and the associated value. <?php // include "../index.php"; $name = $_REQUEST["name"]; echo "<pre>"; echo "hello ?name=$name"; $number = 9; while ($number > 0) { $result = $number - 1; echo " $number - 1 = $result "; $number--; } The above is the code in a file named https://www.chas.us/test/no_pw.php With your developer tools tuned to the network tab you can load this page. you can provide it different querystrings in order to trigger Cloudflare to react and cache it, while you study the cf-cache-status flag https://www.chas.us/test/no_pw.php?name=chcs CF-CACHE-STATUS = MISS reload CF-CACHE-STATUS = HIT What does this mean? It means that you made a request, through Cloudflare, to get the page. Cloudflare realized it didn't have a copy of it, so it went to the server directly for it. When the server created the html, Cloudflare served it to you and stored it. However, on your subsequent reloads, Cloudflare will realize that it has the copy and serve it directly to you, without requiring your server to execute php to recreate it. You have effectively "HIT" the cached version. I have a second file where I merely un-comment the include line that bootstraps Processwire. I did this as the most bare-bones attempt at troubleshooting what I was seeing in a conventional Processwire site/templates driven website. With your developer tools tuned to the network tab... And following the same procedure you did above https://www.chas.us/test/pw_included.php?name=ohhello CF-CACHE-STATUS = BYPASS reload CF-CACHE-STATUS = BYPASS As you can see, I am not using any Processwire methods to output code, but when I include it when generating the page... something about it causes Cloudflare to not cache the generated page. This is a problem whether I am bootstrapping PW (like the above bare-bones example) or whether I am using it in the standard conventional way for a proper website. Cloudflare seems to always get bypassed so that the server can create the the page. I've also attempted to change the template cache value to see if that would somehow enable Cloudflare to serve the page, but it does not. Not sure how to proceed, as this finding seems to indicate that I cannot leverage the speed of Cloudflare on websites that employ Processwire to generate the html markup. Help!
×
×
  • Create New...