• Hello,

    Nothing is being cached when I enable this plugin because it emits a PHP session cookie, bypassing the cache always.

    I just installed & activated this vcaching plugin to one of my wordpress sites. Before I installed the plugin, things were caching albeit with the 120s varnish default TTL. However, after I activate this plugin, all caching stops.

    Here’s an example showing the headers when I query my site using curl with this ‘vcaching’ plugin disabled:

    user@disp82:~$ curl -I https://michaelaltfield.net/
    HTTP/1.1 200 OK
    Server: nginx
    Date: Thu, 21 May 2020 07:57:53 GMT
    Content-Type: text/html; charset=UTF-8
    Content-Length: 4728
    Connection: keep-alive
    X-Frame-Options: SAMEORIGIN
    Link: <https://michaelaltfield.net/wp-json/>; rel="https://api.w.org/"
    Link: <https://michaelaltfield.net/>; rel=shortlink
    Vary: Accept-Encoding
    X-Content-Type-Options: nosniff
    X-XSS-Protection: 1; mode=block
    X-Frame-Options: deny
    Referrer-Policy: strict-origin
    X-Varnish: 558131
    Age: 0
    Via: 1.1 varnish (Varnish/6.1)
    Accept-Ranges: bytes
    X-Frame-Options: SAMEORIGIN
    X-XSS-Protection: 1; mode=block
    Strict-Transport-Security: max-age=1;includeSubDomains
    
    user@disp82:~$ 

    Then when I activate the plugin (and purge the cache), I get this (note the PHPSESSID cookie):

    user@disp82:~$ curl -I https://michaelaltfield.net/
    HTTP/1.1 200 OK
    Server: nginx
    Date: Thu, 21 May 2020 07:59:23 GMT
    Content-Type: text/html; charset=UTF-8
    Content-Length: 4728
    Connection: keep-alive
    X-Frame-Options: SAMEORIGIN
    Set-Cookie: PHPSESSID=sb4s6rohsot8in5hg73977a5r7; path=/; secure; HttpOnly
    Expires: Thu, 19 Nov 1981 08:52:00 GMT
    Cache-Control: no-store, no-cache, must-revalidate
    Pragma: no-cache
    X-VC-Enabled: true
    X-VC-TTL: 86400
    X-VC-Debug: true
    Link: <https://michaelaltfield.net/wp-json/>; rel="https://api.w.org/"
    Link: <https://michaelaltfield.net/>; rel=shortlink
    Vary: Accept-Encoding
    Content-Encoding: gzip
    X-Content-Type-Options: nosniff
    X-XSS-Protection: 1; mode=block
    X-Frame-Options: deny
    Referrer-Policy: strict-origin
    X-Varnish: 101052
    Age: 0
    Via: 1.1 varnish (Varnish/6.1)
    X-Frame-Options: SAMEORIGIN
    X-XSS-Protection: 1; mode=block
    Strict-Transport-Security: max-age=1;includeSubDomains
    
    user@disp82:~$ 

    I isolated the issue to the following line of the ‘vcaching’ code:

    * https://plugins.trac.www.ads-software.com/browser/vcaching/tags/1.8.3/vcaching.php#L109

    When that session_start(); line is removed from the init() function of vcaching.php, the cookie disappears. When it’s added-back, the cookie re-appears.

    I’m running the latest version of wordpress (v5.4.1) and the latest version of vcaching (v1.8.3). The theme is Twenty Eleven.

    I’m assuming this is a bug?

    • This topic was modified 4 years, 6 months ago by maltfield.
    • This topic was modified 4 years, 6 months ago by maltfield.
Viewing 1 replies (of 1 total)
  • Thread Starter maltfield

    (@maltfield)

    Update: I also deactivated all plugins, and the cookie went away. I activated just ‘vcaching’ and the cookie came back.

    Therefore this does not appear to be a conflict with another plugin.

    Also, checking the code for check_if_purgeable(), it may be important to note that this is for a multisite wordpress install.

    • This reply was modified 4 years, 6 months ago by maltfield.
    • This reply was modified 4 years, 6 months ago by maltfield.
    • This reply was modified 4 years, 6 months ago by maltfield.
Viewing 1 replies (of 1 total)
  • The topic ‘Session cookie prevents caching’ is closed to new replies.