Coder Social home page Coder Social logo

Comments (5)

pkiula avatar pkiula commented on May 29, 2024 1

Super, thank you Pothi. What a valuable contribution to the community. Much appreciated!

from wordpress-nginx.

pothi avatar pothi commented on May 29, 2024

Thank you for your time to test the configuration in this repo.

WP Super Cache creates mobile version of the cache for the home page at wp-content/cache/supercache/example.com/index-mobile.html (for non-https sites) or at /wp-content/cache/supercache/example.com/index-https-mobile.html (for HTTPS sites). So, in /wp-content/cache/supercache/$host${uri}index$https_suffix-mobile.html, the following are variables...

  1. $host
  2. $uri
  3. $https_suffix

https_suffix is defined at https://github.com/pothi/wordpress-nginx/blob/master/conf.d/common.conf#L35-L36 . It is used by WP Rocket plugin as well. So, it is defined in a common place to avoid duplication in code. So, suffix-mobile doesn't mean anything. It is actually https_suffix that has a meaning in the above code.

Our theme is completely responsive. Same pages and URLs get served to all devices. Is this still relevant to us?

No, not relevant to your theme. 99% of sites don't use a separate mobile cache. That's why the mobile cache is not enabled by default. Just updated the inline documentation to reflect this point. Please see https://github.com/pothi/wordpress-nginx/blob/master/globals/wp-super-cache.conf#L37-L42 .

from wordpress-nginx.

pkiula avatar pkiula commented on May 29, 2024

Quick additional question. I'm not seeing the X-Cache header at all. Reference to this:

try_files "/wp-content/cache/supercache/$host${uri}index-https.html" $uri $uri/ /index.php$is_args$args;

    #--> all the following would apply, only if the request hits the cache

    add_header "X-Cache" "HIT - WP Super Cache";

Any ideas on how to diagnose why Nginx is not picking up the cached file? Looking manually at the folders on our server, the files do exist. I can also query the files with the path name manually typed in browser for the supercache path. Note that the https is hardcoded in our case, because we only have forced https. No http version of the site.

Welcome any thoughts!

from wordpress-nginx.

pothi avatar pothi commented on May 29, 2024

Best way to debug is to enable debug log in Nginx and run a single request to diagnose further. Please see https://nginx.org/en/docs/debugging_log.html#clients under the header "Debugging log for selected clients" to debug selected clients.

From what I can guess, the cached content may be located at /cms/wp-content/cache/supercache/$host${uri}index-https.html in your particular installation.

from wordpress-nginx.

pkiula avatar pkiula commented on May 29, 2024

Thank you. This is very helpful. Unfortunately our Nginx is not compiled with --with-debug capability. You're right, we should have the /cms/ at the front. Even with that though it doesn't seem to be bringing the super-cache page. Hmm..

from wordpress-nginx.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.