• Resolved 610216

    (@610216-1)


    I found that define(‘WP_CACHE’, true); must be enabled to have the caching function.

    define( 'WP_CACHE', true );

    Author, are you sure if this is the case. If it is, I hope it will be pointed out in the installation instructions.

    In addition, I found that there is a cache file in the wp-content/cache directory, but the headers are X-Cache miss.

    • This topic was modified 2 years, 4 months ago by 610216.
Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter 610216

    (@610216-1)

    /etc/php.d/10-opcache.ini, /etc/php.d/15-xdebug.ini, /etc/php.d/20-bcmath.ini, /etc/php.d/20-bz2.ini, /etc/php.d/20-calendar.ini, /etc/php.d/20-ctype.ini, /etc/php.d/20-curl.ini, /etc/php.d/20-dba.ini, /etc/php.d/20-dom.ini, /etc/php.d/20-enchant.ini, /etc/php.d/20-exif.ini, /etc/php.d/20-fileinfo.ini, /etc/php.d/20-ftp.ini, /etc/php.d/20-gd.ini, /etc/php.d/20-gettext.ini, /etc/php.d/20-iconv.ini, /etc/php.d/20-imap.ini, /etc/php.d/20-intl.ini, /etc/php.d/20-json.ini, /etc/php.d/20-ldap.ini, /etc/php.d/20-mbstring.ini, /etc/php.d/20-mysqlnd.ini, /etc/php.d/20-odbc.ini, /etc/php.d/20-pdo.ini, /etc/php.d/20-pgsql.ini, /etc/php.d/20-phar.ini, /etc/php.d/20-posix.ini, /etc/php.d/20-pspell.ini, /etc/php.d/20-shmop.ini, /etc/php.d/20-simplexml.ini, /etc/php.d/20-snmp.ini, /etc/php.d/20-soap.ini, /etc/php.d/20-sockets.ini, /etc/php.d/20-sodium.ini, /etc/php.d/20-sqlite3.ini, /etc/php.d/20-sysvmsg.ini, /etc/php.d/20-sysvsem.ini, /etc/php.d/20-sysvshm.ini, /etc/php.d/20-tidy.ini, /etc/php.d/20-tokenizer.ini, /etc/php.d/20-xml.ini, /etc/php.d/20-xmlwriter.ini, /etc/php.d/20-xsl.ini, /etc/php.d/30-mcrypt.ini, /etc/php.d/30-mysqli.ini, /etc/php.d/30-pdo_mysql.ini, /etc/php.d/30-pdo_odbc.ini, /etc/php.d/30-pdo_pgsql.ini, /etc/php.d/30-pdo_sqlite.ini, /etc/php.d/30-recode.ini, /etc/php.d/30-xmlreader.ini, /etc/php.d/30-xmlrpc.ini, /etc/php.d/30-zip.ini, /etc/php.d/40-imagick.ini, /etc/php.d/40-memcache.ini, /etc/php.d/40-ssh2.ini

    This program makes use of the Zend Scripting Language Engine:
    Zend Engine v3.4.0, Copyright (c) Zend Technologies
        with Zend OPcache v7.4.26, Copyright (c), by Zend Technologies
        with Xdebug v2.9.8, Copyright (c) 2002-2020, by Derick Rethans
    Plugin Author Konstantin Kovshenin

    (@kovshenin)

    Thanks for reaching out!

    Cache should indeed be enabled in wp-config.php, however during installation, Surge does this for you if the file is writeable. It will also create a file called wp-content/advanced-cache.php which is also necessary for page caching to work.

    If both those things are present on your site, but you are still not getting a cache hit, then changes are your request somehow unique, for example a unique cookie is set during the request, or perhaps you are logged in, or maybe a plugin is sending a “Cache-Control: no-cache” header. I could try and help you troubleshoot this further if you could share the URL of your site where the plugin is installed and activated.

    Konstantin

    Thread Starter 610216

    (@610216-1)

    I’m sure WP_CACHE is true, and there is a wp-content/advanced-cache.php file created by surge.

    There are also cache files generated by surge in the cache directory wp-content/cache, but all the cache files are opened and found to contain “X-Cache”: “miss”.

    Response

    HTTP/1.1 200 OK
    Date: Sat, 11 Dec 2021 05:11:20 GMT
    Server: Apache/2.4.6 (CentOS) OpenSSL/1.0.2k-fips PHP/7.4.26
    X-Cache: miss
    Link: <https://wpmore.cn/wp-json/>; rel="https://api.w.org/"
    Vary: Accept-Encoding
    Content-Encoding: gzip
    Access-Control-Allow-Origin: *
    X-UA-Compatible: IE=edge
    X-Content-Type-Options: nosniff
    X-XSS-Protection: 1; mode=block
    Content-Length: 8723
    Keep-Alive: timeout=5, max=100
    Connection: Keep-Alive
    Content-Type: text/html; charset=UTF-8

    Request

    GET / HTTP/1.1
    Host: wpmore.cn
    Connection: keep-alive
    Cache-Control: max-age=0
    sec-ch-ua: " Not A;Brand";v="99", "Chromium";v="96", "Microsoft Edge";v="96"
    sec-ch-ua-mobile: ?0
    sec-ch-ua-platform: "Windows"
    Upgrade-Insecure-Requests: 1
    User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.55 Safari/537.36 Edg/96.0.1054.43
    Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9
    Sec-Fetch-Site: none
    Sec-Fetch-Mode: navigate
    Sec-Fetch-User: ?1
    Sec-Fetch-Dest: document
    Accept-Encoding: gzip, deflate, br
    Accept-Language: zh-CN,zh;q=0.9,en;q=0.8,en-GB;q=0.7,en-US;q=0.6
    Cookie: _ga=GA1.2.1805901509.1638368896; wordpress_test_cookie=WP%20Cookie%20check; Hm_lvt_26f6623317fb29421825469cff442905=1638884037,1639060280,1639154163,1639198474; Hm_lpvt_26f6623317fb29421825469cff442905=1639199327

    Site url

    https://wpmore.cn/

    • This reply was modified 2 years, 4 months ago by 610216.
    Plugin Author Konstantin Kovshenin

    (@kovshenin)

    Hi there!

    I can see Surge is working fine on your site. However, the reason for the cache misses is because there are unique cookies being issued, like this:

    Cookie: Hm_lvt_26f6623317fb29421825469cff442905=1639203948; Hm_lpvt_26f6623317fb29421825469cff442905=1639203948

    This causes the page cache to not work. It’s likely coming from a theme or plugin, some script perhaps. If you can remove that, you will get cache hits.

    Hope that helps!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘X-Cache miss’ is closed to new replies.