Domanda

Problema

Sto impostando AuthCache per lavorare con Varnish come backend.

Viene fornito con un eccellente predefinito.vcl che è molto ben documentato. Ha la sezione seguente sui cookie. Varnish salta la cache se i cookie sono abilitati, quindi l'esempio seguente sembrerebbe rimuovere tutti i cookie in modo che possa la cache.

Tuttavia ho scoperto che se non commetto questa sezione Authcache smette di memorizzare nella cache. Se lo lascio commentato, continua a cache e la funzionalità dei cookie sembra funzionare. (Ad esempio, ho cookie che ricordano lo stato delle sfaccettature attraverso gli aggiornamenti della pagina e continuano a funzionare).

Non è questo il modo sbagliato?

(Sto usando Authcache Debug per testare la memorizzazione nella cache).

// * Example 2: Remove all but
  // * - the session cookie (SESSxxx, SSESSxxx)
  // * - the cache invalidation cookie for authcache p13n (aucp13n)
  // * - the NO_CACHE cookie from the Bypass Advanced module
  // * - the nocache cookie from authcache
  // *
  // * Note: Please also add the has_js cookie to the list if Authcache Ajax
  // * is also enabled in the backend. Also if you have Authcache Debug enabled,
  // * you should let through the aucdbg cookie.
  // *
  // * More information on:
  // * https://www.varnish-cache.org/docs/3.0/tutorial/cookies.html
  // */
  //if (req.http.Cookie) {
  // set req.http.Cookie = ";" + req.http.Cookie;
  // set req.http.Cookie = regsuball(req.http.Cookie, "; +", ";");
  // set req.http.Cookie = regsuball(req.http.Cookie, ";(S?SESS[a-z0-9]+|aucp13n|NO_CACHE|nocache|aucdbg)=", "; \1=");
  // set req.http.Cookie = regsuball(req.http.Cookie, ";[^ ][^;]*", "");
  // set req.http.Cookie = regsuball(req.http.Cookie, "^[; ]+|[; ]+$", "");
  //  if (req.http.Cookie == "") {
  //   unset req.http.Cookie;
  //  }
 //}

Nessuna soluzione corretta

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a drupal.stackexchange
scroll top