Giter Site home page Giter Site logo

Use dclone on cache_control about mccs HOT 3 CLOSED

SineSwiper avatar SineSwiper commented on May 23, 2024
Use dclone on cache_control

from mccs.

Comments (3)

ido50 avatar ido50 commented on May 23, 2024

I'm having trouble seeing this happening. Does this happen for requests to the same file? Different files? Files of the same type? When there's a global default? When there's an extension specific default?

I've ran a ton of tests and can't seem to recreate this bug. I need more info, or some kind of an example.

from mccs.

SineSwiper avatar SineSwiper commented on May 23, 2024

It's right there in the code:

$cache_control = $self->defaults->{cache_control}
    if $self->defaults && defined $self->defaults->{cache_control};
    # ...
    $cache_control = $self->types->{$ext}->{cache_control}
        if $self->types && $self->types->{$ext} && defined $self->types->{$ext}->{cache_control};
    # ...
unshift(@$cache_control, 'max-age='.$valid_for)
    if $cache;

$self->defaults->{cache_control} is an array ref, which you define as $cache_control. Same thing for $self->types->{$ext}->{cache_control}. In either case, you then unshift the array ref with a "max-age" param. This is the single reference to the default cache_control, not a copy.

I really don't know how to explain it any further without insulting your intelligence.

from mccs.

ido50 avatar ido50 commented on May 23, 2024

I saw the problem in the code, realized it's wrong, but for some reason the tests did not display that behavior, though I might be missing something.

Anyway, bug fixed in new version (will release later today), thanks for reporting.

from mccs.

Related Issues (2)

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.