Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Impossible to use a custom etag generator per rule #2

Open
2 tasks done
weierophinney opened this issue Dec 31, 2019 · 0 comments
Open
2 tasks done

Impossible to use a custom etag generator per rule #2

weierophinney opened this issue Dec 31, 2019 · 0 comments

Comments

@weierophinney
Copy link
Contributor

  • I was not able to find an open or closed issue matching what I'm seeing.
  • This is not a question. (Questions should be asked on chat (Signup here) or our forums.)

Provide a narrative description of what you are trying to accomplish.

Code to reproduce the issue

return [
    'zf-http-cache' => [
        'enable' => true,
        'controllers' => [
            'User\Controller\User::userAvatar' => [
                'get' => [
                    'etag' => [
                        'override' => false,
                        'generator' => \Adsdaq\Infrastructure\Cache\Http\AdsdaqETagGenerator::class,
                    ]
                ]
            ],
        ]
    ]
]

Expected results

I expect that for this Controller action that specific etag generator would be used.

Actual results

The default etag generator keeps being used.

My observations

Looking at the code and unit tests it was clear to me that it's only possible to load a global custom etag generator via:

return [
    'zf-http-cache' => [
        'enable' => true,
        'etag' => [
            'generator' => \Adsdaq\Infrastructure\Cache\Http\AdsdaqETagGenerator::class,
        ],
        'controllers' => [
           ...
        ]
    ]
]

If my observations are right, what are the expectations, should it be possible to a) inject custom etag per rule or b) update the documentation to align with a single global override.

Or am I completely missing something?

Thanks in advance

Cheers


Originally posted by @tonivdv at zfcampus/zf-http-cache#18

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant