Skip to content
This repository has been archived by the owner on Jan 21, 2020. It is now read-only.

Impossible to use a custom etag generator per rule #18

Open
2 tasks done
tonivdv opened this issue Apr 29, 2019 · 1 comment
Open
2 tasks done

Impossible to use a custom etag generator per rule #18

tonivdv opened this issue Apr 29, 2019 · 1 comment

Comments

@tonivdv
Copy link

tonivdv commented Apr 29, 2019

  • 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

@weierophinney
Copy link
Member

This repository has been closed and moved to laminas-api-tools/api-tools-http-cache; a new issue has been opened at laminas-api-tools/api-tools-http-cache#2.

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

No branches or pull requests

2 participants