Skip to content

3.0.x.x This commit introduces a new cache driver for APCu (APC User Cache).#15189

Merged
mhcwebdesign merged 4 commits intoopencart:3.0.x.xfrom
varyagnord:3.0.x.x
Nov 14, 2025
Merged

3.0.x.x This commit introduces a new cache driver for APCu (APC User Cache).#15189
mhcwebdesign merged 4 commits intoopencart:3.0.x.xfrom
varyagnord:3.0.x.x

Conversation

@varyagnord
Copy link
Copy Markdown

Reasoning:
APCu is the modern, actively maintained successor to the old APC extension. It provides a significant performance improvement over the default file-based caching mechanism, which is especially beneficial for busy stores. Adding this driver gives store owners with modern server environments a high-performance caching option out-of-the-box.

Implementation Details:

The driver implements all required methods of the cache interface: get, set, delete, and deleteAll.

It properly checks if the apcu PHP extension is loaded before attempting to use it.

It respects the CACHE_PREFIX constant to avoid potential key collisions on shared servers.

The deleteAll method (used for clearing cache by prefix) is implemented efficiently using APCIterator.

This commit introduces a new cache driver for APCu (APC User Cache).

Reasoning:
APCu is the modern, actively maintained successor to the old APC extension. It provides a significant performance improvement over the default file-based caching mechanism, which is especially beneficial for busy stores. Adding this driver gives store owners with modern server environments a high-performance caching option out-of-the-box.

Implementation Details:

    The driver implements all required methods of the cache interface: get, set, delete, and deleteAll.

    It properly checks if the apcu PHP extension is loaded before attempting to use it.

    It respects the CACHE_PREFIX constant to avoid potential key collisions on shared servers.

    The deleteAll method (used for clearing cache by prefix) is implemented efficiently using APCIterator.
Add new APCu cache driver for high-performance caching
@ADDCreative
Copy link
Copy Markdown
Contributor

The delete method needs to support deleting cache by prefix and wildcards.

See #12030 and #9739.

@varyagnord
Copy link
Copy Markdown
Author

Latest commit includes the requested updates. Thanks for the feedback!

@mhcwebdesign
Copy link
Copy Markdown
Contributor

@ADDCreative : Can you verify that these latest changes (deleting cache by prefix and wildcards) are now correctly implemented? If they are, I'll do the merge.

…nality verification

- Replaced APCUIterator constructor call with correct signature (pattern + APC_ITER_KEY)
- Performed complete end-to-end validation of all cache operations (get/set/delete/clear/list)
- Verified stable behavior on PHP 7.4–8.4 with APCu enabled

This version represents a final, production-ready implementation of the APCu cache driver based solely on APCUIterator, without any external registry.
@varyagnord
Copy link
Copy Markdown
Author

@ADDCreative : Can you verify that these latest changes (deleting cache by prefix and wildcards) are now correctly implemented? If they are, I'll do the merge.

Everything has now been fully tested — the iterator fix and wildcard deletion work as expected.
The driver is stable and ready to be merged. Thanks again for reviewing!

@mhcwebdesign mhcwebdesign merged commit 356612d into opencart:3.0.x.x Nov 14, 2025
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.

3 participants