• Resolved betumayo

    (@betumayo)


    Hi i have activated cloudflare full cache in sg optimizer and also upgraded workers 5 dollars month because i reached limit in one Day.
    Anyway shouldnt this full cache make the site Super fast? I have seen almost no change in speed insights for my site. Do i have to programm somehting else? I have read somehting about rules for static cache but i don’t really understand. Can anyone help me? Also i see in cloudfare that half of the request come from origin and not from cloudflare why?

    The page I need help with: [log in to see the link]

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author Stoyan Georgiev

    (@stoyangeorgiev)

    Hey there @betumayo,

    I had a look at your website headers and it looks like there is a cache-control header max-age=0. The header Cache-Control: max-age=0 implies that the content is considered stale (and must be re-fetched) immediately, which is in effect the same thing as Cache-Control: no-cache. This may be one of the reasons you are not noticing speed increase after enabling the Cloudflare full page caching through our plugin.

    When using our Cloudflare Full Page Caching when reaching the limit, the requests will just be sent to the origin server.

    I would suggest checking your htaccess for a specific rule setting the max-age=0. Also, this could be caused by another plugin setting, so you should also check your plugins for settings that are adding cache-control:max-age=0. I have also noticed that you are using WP Rocket. Combining multiple cashing plugins may lead to unexpected behaviour and lead to poor results.

    If you still have issues after that feel free to reach back to us.

    Kind Regards,
    Stoyan

    Thread Starter betumayo

    (@betumayo)

    – Hi thank for your answere i will paste down here my htaccess i dont really know how to read it do you see nay line i can change manually?
    also when tryin to test if the url is cached in the SG optimizer section test it ives me “The URL is not cached”

    – i added the wp rocket after i saw that sg optimizer and cloudflare where not givinf me muhc speed after adding wp rocket it helped pushing the speed. but stll feeling its not enough

    – <<When using our Cloudflare Full Page Caching when reaching the limit, the requests will just be sent to the origin server.>> about this if i have paid for the workers to reach no limit then why anywahy half of the request are from origin?

    HTACCESS

    # BEGIN WP Rocket v3.8.8
    # Use UTF-8 encoding for anything served text/plain or text/html
    AddDefaultCharset UTF-8
    # Force UTF-8 for a number of file formats
    <IfModule mod_mime.c>
    AddCharset UTF-8 .atom .css .js .json .rss .vtt .xml
    </IfModule>
    
    # FileETag None is not enough for every server.
    <IfModule mod_headers.c>
    Header unset ETag
    </IfModule>
    
    # Since we’re sending far-future expires, we don’t need ETags for static content.
    # developer.yahoo.com/performance/rules.html#etags
    FileETag None
    
    <IfModule mod_alias.c>
    <FilesMatch "\.(html|htm|rtf|rtx|txt|xsd|xsl|xml)$">
    <IfModule mod_headers.c>
    Header set X-Powered-By "WP Rocket/3.8.8"
    Header unset Pragma
    Header append Cache-Control "public"
    Header unset Last-Modified
    </IfModule>
    </FilesMatch>
    
    <FilesMatch "\.(css|htc|js|asf|asx|wax|wmv|wmx|avi|bmp|class|divx|doc|docx|eot|exe|gif|gz|gzip|ico|jpg|jpeg|jpe|json|mdb|mid|midi|mov|qt|mp3|m4a|mp4|m4v|mpeg|mpg|mpe|mpp|otf|odb|odc|odf|odg|odp|ods|odt|ogg|pdf|png|pot|pps|ppt|pptx|ra|ram|svg|svgz|swf|tar|tif|tiff|ttf|ttc|wav|wma|wri|xla|xls|xlsx|xlt|xlw|zip)$">
    <IfModule mod_headers.c>
    Header unset Pragma
    Header append Cache-Control "public"
    </IfModule>
    </FilesMatch>
    </IfModule>
    
    # Expires headers (for better cache control)
    <IfModule mod_expires.c>
    	ExpiresActive on
    	ExpiresDefault                              "access plus 1 month"
    	# cache.appcache needs re-requests in FF 3.6 (thanks Remy ~Introducing HTML5)
    	ExpiresByType text/cache-manifest           "access plus 0 seconds"
    	# Your document html
    	ExpiresByType text/html                     "access plus 0 seconds"
    	# Data
    	ExpiresByType text/xml                      "access plus 0 seconds"
    	ExpiresByType application/xml               "access plus 0 seconds"
    	ExpiresByType application/json              "access plus 0 seconds"
    	# Feed
    	ExpiresByType application/rss+xml           "access plus 1 hour"
    	ExpiresByType application/atom+xml          "access plus 1 hour"
    	# Favicon (cannot be renamed)
    	ExpiresByType image/x-icon                  "access plus 1 week"
    	# Media: images, video, audio
    	ExpiresByType image/gif                     "access plus 4 months"
    	ExpiresByType image/png                     "access plus 4 months"
    	ExpiresByType image/jpeg                    "access plus 4 months"
    	ExpiresByType image/webp                    "access plus 4 months"
    	ExpiresByType video/ogg                     "access plus 4 months"
    	ExpiresByType audio/ogg                     "access plus 4 months"
    	ExpiresByType video/mp4                     "access plus 4 months"
    	ExpiresByType video/webm                    "access plus 4 months"
    	# HTC files  (css3pie)
    	ExpiresByType text/x-component              "access plus 1 month"
    	# Webfonts
    	ExpiresByType font/ttf                      "access plus 4 months"
    	ExpiresByType font/otf                      "access plus 4 months"
    	ExpiresByType font/woff                     "access plus 4 months"
    	ExpiresByType font/woff2                    "access plus 4 months"
    	ExpiresByType image/svg+xml                 "access plus 1 month"
    	ExpiresByType application/vnd.ms-fontobject "access plus 1 month"
    	# CSS and JavaScript
    	ExpiresByType text/css                      "access plus 1 year"
    	ExpiresByType application/javascript        "access plus 1 year"
    </IfModule>
    # Gzip compression
    <IfModule mod_deflate.c>
    # Active compression
    SetOutputFilter DEFLATE
    # Force deflate for mangled headers
    <IfModule mod_setenvif.c>
    <IfModule mod_headers.c>
    SetEnvIfNoCase ^(Accept-EncodXng|X-cept-Encoding|X{15}|~{15}|-{15})$ ^((gzip|deflate)\s*,?\s*)+|[X~-]{4,13}$ HAVE_Accept-Encoding
    RequestHeader append Accept-Encoding "gzip,deflate" env=HAVE_Accept-Encoding
    # Don’t compress images and other uncompressible content
    SetEnvIfNoCase Request_URI \
    \.(?:gif|jpe?g|png|rar|zip|exe|flv|mov|wma|mp3|avi|swf|mp?g|mp4|webm|webp|pdf)$ no-gzip dont-vary
    </IfModule>
    </IfModule>
    
    # Compress all output labeled with one of the following MIME-types
    <IfModule mod_filter.c>
    AddOutputFilterByType DEFLATE application/atom+xml \
    		                          application/javascript \
    		                          application/json \
    		                          application/rss+xml \
    		                          application/vnd.ms-fontobject \
    		                          application/x-font-ttf \
    		                          application/xhtml+xml \
    		                          application/xml \
    		                          font/opentype \
    		                          image/svg+xml \
    		                          image/x-icon \
    		                          text/css \
    		                          text/html \
    		                          text/plain \
    		                          text/x-component \
    		                          text/xml
    </IfModule>
    <IfModule mod_headers.c>
    Header append Vary: Accept-Encoding
    </IfModule>
    </IfModule>
    
    <IfModule mod_mime.c>
    AddType text/html .html_gzip
    AddEncoding gzip .html_gzip
    </IfModule>
    <IfModule mod_setenvif.c>
    SetEnvIfNoCase Request_URI \.html_gzip$ no-gzip
    </IfModule>
    
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteCond %{HTTPS} on [OR]
    RewriteCond %{SERVER_PORT} ^443$ [OR]
    RewriteCond %{HTTP:X-Forwarded-Proto} https
    RewriteRule .* - [E=WPR_SSL:-https]
    RewriteCond %{HTTP:Accept-Encoding} gzip
    RewriteRule .* - [E=WPR_ENC:_gzip]
    RewriteCond %{REQUEST_METHOD} GET
    RewriteCond %{QUERY_STRING} =""
    RewriteCond %{HTTP:Cookie} !(wordpress_logged_in_.+|wp-postpass_|wptouch_switch_toggle|comment_author_|comment_author_email_) [NC]
    RewriteCond %{REQUEST_URI} !^(/(.+/)?feed/?.+/?|/(?:.+/)?embed/|/checkout/(.*)|/cart/|/my-account-2/(.*)|/wc-api/v(.*)|/(index\.php/)?wp\-json(/.*|$))$ [NC]
    RewriteCond %{HTTP_USER_AGENT} !^(facebookexternalhit).* [NC]
    RewriteCond "%{DOCUMENT_ROOT}/wp-content/cache/wp-rocket/%{HTTP_HOST}%{REQUEST_URI}/index%{ENV:WPR_SSL}%{ENV:WPR_WEBP}.html%{ENV:WPR_ENC}" -f
    RewriteRule .* "/wp-content/cache/wp-rocket/%{HTTP_HOST}%{REQUEST_URI}/index%{ENV:WPR_SSL}%{ENV:WPR_WEBP}.html%{ENV:WPR_ENC}" [L]
    </IfModule>
    # END WP Rocket
    
    SetEnv PHPRC /home/customer/www/ponponi.co.il/public_html/php.ini
    RewriteEngine On
    RewriteCond %{HTTPS} off
    RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]]
    
    # BEGIN WordPress
    # ??????? (?????) ??? "BEGIN WordPress" ???? "END WordPress" ??
    # ???? ????? ?????, ??? ????? ???? ?? ??????? ??????? ?? ???????.
    # ?? ????? ??????? ??? ?????? ??? ????.
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>
    
    # END WordPress
    #SetEnv MAGICK_THREAD_LIMIT 1.
    
    ## ENABLE GZIP COMPRESSION ##
    
    ## ENABLE GZIP COMPRESSION ##
    
    ## LEVERAGE BROWSER CACHING ##
    
    ## LEVERAGE BROWSER CACHING ##
    AddHandler application/x-httpd-php72 .php .php5 .php4 .php3
    
    # SGO Unset Vary
      Header unset Vary
    # SGO Unset Vary END
    • This reply was modified 3 years, 10 months ago by betumayo.

    @betumayo,

    Try one of the solutions provided here.

    The solution that worked for us involved adding the following filter to our functions.php file via the Code Snippets plugin:

    add_filter('rocket_htaccess_mod_expires', '__return_false');

    Again, we use both SG Optimizer and WP Rocket. Combined, with no overlapping settings, our website runs faster than with SG Optimizer alone. We have data to support our claim.

    Cheers!

    Thread Starter betumayo

    (@betumayo)

    thank you i tried that but didnt work for me.
    i have no idea how to fix all my cache problems and cloudflare configuration since i am not a developer this has exceed my poor knowledge. i have no idea what are page rules either or how to fix them or why cloudflare dont cach all my site or this headers thing max age i fell like every thing i do i mess things. i feel so frustrated maby i should get a developer expert to have a look if you can recommend someone to pay and fix all the mess

    i still get this:

    Date: Fri, 30 Apr 2021 05:26:52 GMT
    Content-Type: text/html; charset=UTF-8
    Transfer-Encoding: chunked
    Connection: keep-alive
    Set-Cookie: __cfduid=d44532f144daa4e2b488a64264860eca41619760412; expires=Sun, 30-May-21 05:26:52 GMT; path=/; domain=.ponponi.co.il; HttpOnly; SameSite=Lax
    CF-Ray: 647e5b90ad6e07a6-LHR
    Cache-Control: max-age=0, public
    Expires: Fri, 30 Apr 2021 05:26:52 GMT
    Vary: Accept-Encoding
    CF-Cache-Status: DYNAMIC
    cf-request-id: 09c2d78e6c000007a6389d7000000001
    Expect-CT: max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct"
    Host-Header: 6b7412fb82ca5edfd0917e3957f05d89
    SG-Optimizer-Worker-Status: miss
    X-Httpd: 1
    X-Powered-By: WP Rocket/3.8.8
    X-Proxy-Cache: MISS
    X-Proxy-Cache-Info: 0 NC:000000 UP:SKIP_CACHE_MAX_AGE_ZERO
    Report-To: {"endpoints":[{"url":"https:\/\/a.nel.cloudflare.com\/report?s=HD3bpsbPWCbcM6sAh27%2FYZil2984BetG%2FRTpz01%2BQ5ou%2BdMYOnPWCeZo5RbMWppOF8NoFURKHQct%2Bb0cvpxgpJ7x%2BeN8QToimJeTZ84YfysDmQ%3D%3D"}],"group":"cf-nel","max_age":604800}
    NEL: {"max_age":604800,"report_to":"cf-nel"}
    Server: cloudflare
    alt-svc: h3-27=":443"; ma=86400, h3-28=":443"; ma=86400, h3-29=":443"; ma=86400
    Plugin Author Hristo Pandjarov

    (@hristo-sg)

    SiteGround Representative

    Do not use WP Rocket with SG Optimizer. We can’t support other plugins and the way they break our functionality. It is a bad idea to use multiple performance solutions and on SiteGround we recommend only SG Optimizer. Your full page caching is not working because of WP Rocket. DIsable it, delete all the stuff they leave in the .htaccess and wp-config.php files, turn off and back on the Cloudflare full page caching option in SGO and your caching will start working.

    @betumayo,

    Did @hristo-sg’s solution work for you?

    For the solution we provided above to work, once you implement the filter, you need to deactivate then activate WP Rocket.

    Also, add the following filter to you functions.php file (directly or via Code Snippets) to deactivate GZip Compression in WP Rocket: (GZip Compression provided automatically by SG Optimizer)

    add_filter('rocket_htaccess_mod_deflate', '__return_false');

    Again, once you add the above filter, deactivate then activate WP Rocket. You should be good to go.

    Cheers!

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Cloudfare full cache not faster’ is closed to new replies.