Skip to content

Remove the Proxy cache adapter - #7

Merged
Meldiron merged 1 commit into
mainfrom
remove-cache-proxy
Aug 13, 2026
Merged

Remove the Proxy cache adapter#7
Meldiron merged 1 commit into
mainfrom
remove-cache-proxy

Conversation

@Meldiron

@Meldiron Meldiron commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

What does this PR do?

Deletes Cache\Adapter\Proxy.

It hard-codes one deployment's routing into the library:

new Proxy(
    appDomain: 'app.example.com',
    appDomainAdapter: $cloudflareCache,
    networkAdapter: $fastlyCache,
    customDomainAdapters: [$cloudflareCache, $fastlyCache],
    networkDomains: ['network.example.com'],
);

An app domain, a set of network domains, and a list of adapters for everything else. A consumer whose split is not exactly that cannot use it; a consumer whose split is that has encoded its own topology in a dependency it does not control, and has to ship a library release to change it.

#4 has since established that it cannot route key purges at all — keys are scoped to a Fastly service or a Cloudflare zone, so purgeKeys() now throws and the README tells consumers to pick the adapter themselves before constructing Cache:

$adapter = $cdnAdapterResolver->resolve($rule);

$cache = new Cache($adapter);
$cache->purgeKeys(['domain-' . \strtolower($domain)]);

That is the right conclusion, and it is not specific to keys. Once the consumer is resolving the adapter for one operation it holds the routing context for all of them, and what is left of Proxy is a domain-shaped special case of something the consumer already does.

Nothing uses it. Its only references anywhere were its own test and the README section documenting it — no other class in this library, and no usage in appwrite-labs/cloud, which routes purges itself.

Certificates\Provider\Proxy is a different class and is untouched. Exception\Configuration and Exception\UnsupportedOperation both stay, since the certificate providers still use them.

Test Plan

composer test — 22 tests, 45 assertions, down from 26/49 on main: the four removed are ProxyTest's own, and every other test passes untouched, which is the evidence that nothing depended on it.

composer analyse (level 6) reports [OK] No errors — relevant here because PHPStan would flag any surviving reference to the deleted class. composer lint passes.

I checked for usage by grepping this repository and appwrite-labs/cloud for Adapter\Proxy, Adapter/Proxy and new Proxy( outside the certificates namespace; the only hits were the two files this PR deletes and the README section it removes.

Breaking changes

Removing a public class is breaking for anyone constructing it. The library is 0.0.x and the class is unreferenced in the only consumer I know of.

Related PRs and Issues

Groundwork for #5, which introduces a filter-based Cache\Adapter\Balancer covering the same fan-out need without the library holding a topology.

Note for ordering: #6 currently adds a method to Proxy, so it will need a rebase once this merges — the conflict resolves by dropping that part of it.

Checklist

  • I read the contributing guide
  • I ran composer lint
  • I ran composer analyse
  • I ran composer test

🤖 Generated with Claude Code

@greptile-apps

greptile-apps Bot commented Aug 13, 2026

Copy link
Copy Markdown

Greptile Summary

Removes the unused topology-specific cache routing adapter and its associated documentation and tests.

  • Deletes Utopia\Cdn\Cache\Adapter\Proxy.
  • Removes the README cache-routing example.
  • Removes the adapter’s dedicated test suite.

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains.

Important Files Changed

Filename Overview
README.md Removes documentation and examples for the deleted cache routing adapter.
src/Cdn/Cache/Adapter/Proxy.php Deletes the unused public cache routing adapter without leaving repository references or class-specific metadata.
tests/Cdn/Cache/Adapter/ProxyTest.php Removes tests exclusively covering the deleted adapter.

Fix All in Greploop

Reviews (2): Last reviewed commit: "Remove the Proxy cache adapter" | Re-trigger Greptile

@Meldiron Meldiron left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm, #5 adds replacement adapter

Cache\Adapter\Proxy hard-codes one deployment's routing into the library:
an app domain, a set of network domains, and a list of adapters for
everything else. Any consumer whose split is not exactly that cannot use
it, and a consumer whose split is that has encoded its topology in a
dependency it does not control.

#4 has since established that it cannot route key purges at all, since keys
are scoped to a service or zone, and told consumers to select the adapter
themselves before constructing Cache. That is the same conclusion for every
operation, not only keys.

Nothing uses it. Its only references were its own test and the README.

Certificates\Provider\Proxy is untouched; this removes the cache adapter
only.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@Meldiron
Meldiron force-pushed the remove-cache-proxy branch from 2e2c1eb to 15d52ed Compare August 13, 2026 18:54
@Meldiron
Meldiron merged commit 2f97735 into main Aug 13, 2026
4 checks passed
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

Successfully merging this pull request may close these issues.

2 participants