GithubHelp home page GithubHelp logo

Comments (9)

csandanov avatar csandanov commented on June 9, 2024

Caching is disabled on Varnish for authenticated users in Drupal preset. You probably have an issue somewhere else.

from varnish.

jacobsaw avatar jacobsaw commented on June 9, 2024

Wouldn't the pass for authenticated users occur too late though? If I move the preset include above the static include and/or remove VARNISH_CACHE_STATIC_FILES, the page is delivered as expected.

from varnish.

csandanov avatar csandanov commented on June 9, 2024

Please describe how to reproduce this issue, it works fine for me with Drupal 8 and enabled/disabled VARNISH_CACHE_STATIC_FILES

from varnish.

jacobsaw avatar jacobsaw commented on June 9, 2024

Recreated with vanilla docker4drupal with VARNISH_CACHE_STATIC_FILES enabled for both Drupal 7 and Drupal 8.

Steps to recreate:

  • Install Drupal
  • Configure private file system and add a field to a content type that uses the private file system (Article has one if using standard install)
  • Create an unpublished node

Expected result:

  • Anonymous users should get a 403 and users with appropriate permissions should see the file
  • Both anonymous and authenticated users receive a 403

from varnish.

csandanov avatar csandanov commented on June 9, 2024

Thank you. I was able to reproduce the issue (I thought you always get 403 when access isn't restricted). Indeed the original issue with the ordering of cookies strip remained, it's probably was reversed because the way it was fixed wasn't right and broke other things. The fix has been applied, please check the latest version.

from varnish.

jacobsaw avatar jacobsaw commented on June 9, 2024

Perfect, pulled the latest and my original issue is resolved. Thank you for the fix!

from varnish.

drasgardian avatar drasgardian commented on June 9, 2024

It looks like this change has disabled the caching ALL static files for authenticated users if a preset is being used.

While it is good that Drupal private files (/system/files/*) should not be cached for authenticated users, there are lots of other files that should still be cached. e.g. public files, css, js, images included in theme or module folders etc.

How about putting includes/static.vcl back above the presets, but checking for VARNISH_DRUPAL_EXCLUDE_URLS inside static.vcl?

from varnish.

pprishchepa avatar pprishchepa commented on June 9, 2024

@drasgardian do you have VARNISH_CACHE_STATIC_FILES enabled in your environment? It's required because static files not cached by default.

from varnish.

gene-miller avatar gene-miller commented on June 9, 2024

@PavelPrischepa (working with @drasgardian) yes we do have VARNISH_CACHE_STATIC_FILES enabled. The order of operations in the default VCL means that this has no effect for authenticated users.

from varnish.

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.