Git Product home page Git Product logo

Comments (8)

twajr avatar twajr commented on July 17, 2024

@thet Do you have any particular implementation idea in mind? I'm also looking for something to make cookie specification more generic. Thoughts are appreciated and I'll add to this project if it makes sense to the maintainers.

from eea.docker.varnish.

twajr avatar twajr commented on July 17, 2024

@avoinea The pattern described by @thet above is similar to what we do. Can you comment on this proposal to provide some cookie configuration in the eea image:

A new piece of python, config_cookies.py that is called toward the beginning of docker-entrypoint.sh to extract cookie configuration details from new environment variables similar to how it's done in add_backends.py. It would write the output to conf.d for ultimately inclusion in the final .vcl via the normal iteration.

It would consist of three main areas: cookies for pass, cookie removal, and maybe config for pipe of large files. This is consistent to both our needs an those mentioned by thet. Feedback is appreciated.

from eea.docker.varnish.

avoinea avatar avoinea commented on July 17, 2024

@twajr A pull-request would be appreciated as I don't really get it where should this be inserted.

Thank you!

from eea.docker.varnish.

twajr avatar twajr commented on July 17, 2024

@avoinea Okay, I'll do a bit of work first as it sounds like you're open to the possibility. If it doesn't work out, I'll put in our image. This change, though, may allow us to use your image directly. Give me a day or two. Thanks!

from eea.docker.varnish.

thet avatar thet commented on July 17, 2024

@twajr I'd experiment to remove any cookies for static files. I can't currently think of any use case where file types which are most likely static files would need cookies.
So the first rule would change to (untested):

    /* delete cookies for static resources */
    set req.http.UrlNoQs = regsub(req.url, "\?.*$", "");
    if (req.http.UrlNoQs ~ "\.(js|css|kss|gif|png|jpg|mp3|mp4|pdf)$") {
        unset req.http.cookie;
        return(pipe);
    }

from eea.docker.varnish.

twajr avatar twajr commented on July 17, 2024

@thet Thanks, yeah, that one looks straight forward. I'm going to focus first on adding setup for 'cookie config' similar to backends. Once that is in place, along with the first item (which is our requirement for a cookies white list), we can iterate on various cookie options that we expect to configure, like your example.

from eea.docker.varnish.

twajr avatar twajr commented on July 17, 2024

@avoinea I have an initial PR ready, but it's not clear to me how Varnish handles the same vcl_recv sub defined multiple times. It allows me to do it and it compiles, and the default vcl_recv is always placed in the final config as well. So, ultimately with my change there are three defined vcl_recv routines versus two in the current implementation. I'll continue investigating and testing unless you have some words of wisdom around that issue. (Eh, never mind, I can see in the generated C code that all three are called and it must be based on parse order or something). I'll put in a basic PR and we can discuss.

from eea.docker.varnish.

avoinea avatar avoinea commented on July 17, 2024

@twajr Thank you!

eeacms/varnish:4.1-5.0 released!

from eea.docker.varnish.

Related Issues (13)

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.