• Hello. Love this plugin after trying various (Fastest, Super, Total, Rocket, etc). This is simple and has become a part of our starter toolkit.

    On some of our sites which are not at all dynamic, we have Expires headers set to 90 days or so. My question is how far Comet Cache can go to make these sites essentially fully static as if they were just html pages linked together.

    I understand Comet pre-composes whole “pages” and stores them in the DB. As such, when a URL is requested, there’s still a DB query. Comet Cache gets called, which then either pics cache pages from disk, or from a DB query which brings up the whole composed page — instead of composing the page live with various MySQL queries. Is that correct?

    What I’d like: is to have Nginx instructions with the try_files directive to reflect the cache path in the Comet directory. This way when the URL is requested, Nginx will FIRST check if a file exists in the right cache path. If it does, it’ll just serve up that file. WordPress won’t even be called. No Comet, no WP. Just plain file serve as if it were HTML. Only if a cache file is not found will it go through the usual WordPress and Comet routine.

    Is this possible? If so, where can I get some clear instructions on the file URL path construction? Inspiration is from the very helpful configs from Pothi in Github. This is for WP Super Cache:

    https://github.com/pothi/wordpress-nginx/blob/master/globals/wp-super-cache.conf

    Many thanks for any pointers!

Viewing 1 replies (of 1 total)
  • Thread Starter morespinach

    (@morespinach)

    To be even clearer, this is what Nginx configs typically have on WordPress sites:

    try_files $uri $uri/ /index.php$is_args$args;

    Instead, we’d like something like:

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

    In looking at the comet-cache folders, I find the html files have some serialized string at the top before the HTML:

    a:3:{i:0;s:12:"HTTP/2.0 200";i:1;s:38:"Content-Type: text/html; charset=UTF-8";i:2;s:65:"Link: <https://domain.com/wp-json/>; rel="https://api.w.org/"";}<!--headers-->

    Welcome any thoughts on how to compose a static HTML path that becomes an HTML file.

    Many thanks!

Viewing 1 replies (of 1 total)
  • The topic ‘Fully static websites (and if yes, an Nginx config question)’ is closed to new replies.