{"id":2684,"date":"2019-10-23T09:28:28","date_gmt":"2019-10-23T01:28:28","guid":{"rendered":"https:\/\/www.mondoze.com\/guide\/?post_type=kb&#038;p=2684"},"modified":"2022-10-05T08:02:26","modified_gmt":"2022-10-05T00:02:26","slug":"why-is-my-dynamic-content-being-sent-with-chunked-encoding","status":"publish","type":"kb","link":"https:\/\/www.mondoze.com\/guide\/kb\/why-is-my-dynamic-content-being-sent-with-chunked-encoding","title":{"rendered":"Why is my dynamic content being sent with chunked encoding?"},"content":{"rendered":"\t\t<div data-elementor-type=\"wp-post\" data-elementor-id=\"2684\" class=\"elementor elementor-2684\" data-elementor-settings=\"[]\">\n\t\t\t\t\t\t<div class=\"elementor-inner\">\n\t\t\t\t\t\t\t<div class=\"elementor-section-wrap\">\n\t\t\t\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-2818c400 elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"2818c400\" data-element_type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t\t\t<div class=\"elementor-row\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-58efa6f1\" data-id=\"58efa6f1\" data-element_type=\"column\">\n\t\t\t<div class=\"elementor-column-wrap elementor-element-populated\">\n\t\t\t\t\t\t\t<div class=\"elementor-widget-wrap\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-4ff3e47 elementor-widget elementor-widget-heading\" data-id=\"4ff3e47\" data-element_type=\"widget\" data-widget_type=\"heading.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t<h2 class=\"elementor-heading-title elementor-size-default\">Why is my Dynamic Content being Sent with Chunked Encoding?<\/h2>\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-7a4e22af elementor-widget elementor-widget-text-editor\" data-id=\"7a4e22af\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t<div class=\"elementor-text-editor elementor-clearfix\">\n\t\t\t\t<p>If you have resources that do not have a file extension that Cloudflare caches we treat that resource as dynamic HTML. We don&#8217;t cache it by default, and Cloudflare&#8217;s system will send that resource gzipped and with chunked encoding.\u00a0<\/p><p><strong>Note<\/strong> &#8212; it isn&#8217;t possible to have chunk encoding and content-length at the same time so this would explain why content-length would not be sent with these dynamic resource passing through Cloudflare.<\/p><p><strong>Note &#8212;\u00a0<\/strong>Another reason you would not see a content-length header would be if you are sending HTTP 1.1 from your web server. For version 1.1 of the HTTP protocol, the chunked transfer mechanism is consider to be always acceptable. Even if not list in the TE request header field, and when use with other transfer mechanisms, should always be apply last to the transferred data and never more than one time. (Source: <a title=\"wikipedia \" href=\"http:\/\/en.wikipedia.org\/wiki\/Chunked_transfer_encoding\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">wikipedia &#8220;Chunked Encoding&#8221;<\/a>).\u00a0 In this case you need to make sure\u00a0 is sending HTTP 1.0 as the protocol from your web server. If you specifically need the content-length header.<\/p><p><strong>The solution \/ workaround<\/strong> &#8211; If you add a file extension to the resource so that it matches our list of supported file extensions. So <strong>example.com\/test\/dynamicallyimage.php?<\/strong>size=3\u00a0becomes<strong> example.com\/dynamicallyimage.jpg .<\/strong> Cloudflare&#8217;s system will send it with the content-length header. As long as you&#8217;re also sending HTTP 1.0 as the protocol.<\/p><p>Alternatively you could use a PageRule and use the &#8220;custom caching&#8221; option to select &#8220;cache everything&#8221;. After that, it will force our system to cache <strong>example.com\/test\/dynamicallyimage.php?<\/strong>size=3. Even though it doesn&#8217;t have one of our usual file extensions &#8212; in this case the content-length will also be preserved.<\/p>\t\t\t\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t","protected":false},"excerpt":{"rendered":"<p>Why is my Dynamic Content being Sent with Chunked Encoding? If you have resources that do not have a file extension that Cloudflare caches we treat that resource as dynamic HTML. We don&#8217;t cache it by default, and Cloudflare&#8217;s system will send that resource gzipped and with chunked encoding.\u00a0 Note &#8212; it isn&#8217;t possible to &hellip;<\/p>\n<p class=\"read-more\"> <a class=\"\" href=\"https:\/\/www.mondoze.com\/guide\/kb\/why-is-my-dynamic-content-being-sent-with-chunked-encoding\"> <span class=\"screen-reader-text\">Why is my dynamic content being sent with chunked encoding?<\/span> Read More \u00bb<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-gradient":""}}},"kbtopic":[53],"kbtag":[110],"mkb_version":[],"_links":{"self":[{"href":"https:\/\/www.mondoze.com\/guide\/wp-json\/wp\/v2\/kb\/2684"}],"collection":[{"href":"https:\/\/www.mondoze.com\/guide\/wp-json\/wp\/v2\/kb"}],"about":[{"href":"https:\/\/www.mondoze.com\/guide\/wp-json\/wp\/v2\/types\/kb"}],"author":[{"embeddable":true,"href":"https:\/\/www.mondoze.com\/guide\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.mondoze.com\/guide\/wp-json\/wp\/v2\/comments?post=2684"}],"version-history":[{"count":6,"href":"https:\/\/www.mondoze.com\/guide\/wp-json\/wp\/v2\/kb\/2684\/revisions"}],"predecessor-version":[{"id":18734,"href":"https:\/\/www.mondoze.com\/guide\/wp-json\/wp\/v2\/kb\/2684\/revisions\/18734"}],"wp:attachment":[{"href":"https:\/\/www.mondoze.com\/guide\/wp-json\/wp\/v2\/media?parent=2684"}],"wp:term":[{"taxonomy":"kbtopic","embeddable":true,"href":"https:\/\/www.mondoze.com\/guide\/wp-json\/wp\/v2\/kbtopic?post=2684"},{"taxonomy":"kbtag","embeddable":true,"href":"https:\/\/www.mondoze.com\/guide\/wp-json\/wp\/v2\/kbtag?post=2684"},{"taxonomy":"mkb_version","embeddable":true,"href":"https:\/\/www.mondoze.com\/guide\/wp-json\/wp\/v2\/mkb_version?post=2684"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}