Skip to content

Varnish - Error on PURGE request #3460

Closed
@lilmuckers

Description

@lilmuckers

When i clear the cache in the backend (or from saving a product or any of the other means that trigger a varnish PURGE) the purge command comes into varnishlog as "PURGE%00"

Looking at the code, within Zend\Http\Client\Adapter\Socket::write() it's setting a null path to the request.
This appears to be because the Zend\Uri\Uri object doesn't have a path specified, and is returning a null for the path as well.

When I hardcode the request to have a path of / it works just fine and the PURGE commands execute flawlessly.

I'd be inclined to say this is more a Zend bug than a Magento bug, but I'm not 100% sure on this. When I modified Magento\PageCache\Model\Cache\Server::getUris() to have a not-null path (instead I hardcoded a path of /) it did not resolve the issue, Only when I modified the call to Socket::write() to use the method PURGE / (which is terrible and hurt me to my core)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions