Download the PHP package alleyinteractive/wp-page-cache-control without Composer

On this page you can find all versions of the php package alleyinteractive/wp-page-cache-control. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package wp-page-cache-control

WP Page Cache Control

Coding Standards Testing Suite

Control and modify the page cache for multiple hosting providers.

Installation

You can install the package via Composer:

The plugin supports the following hosting providers and their respective page caching systems:

The plugin will attempt to detect the caching system in use and will load the appropriate provider class. It can also be controlled by the wp_page_cache_control_provider hook which should return a provider class string.

The main goal of the plugin is to solve common page cache control needs across multiple hosting providers. It is not meant to be a complete solution for all page cache control needs. If you have a need that is not met by the plugin, please open an issue or pull request.

Usage

The plugin supports back-end page cache control including TTL, bypassing the page cache, user segmentation, and purging from the page cache. It also supports front-end segmentation.

Usage: Back-end

Activate the plugin in WordPress and use the following methods as needed:

Controlling the Time-to-live (TTL) of the Current Request

Disabling the Page Cache for the Current Request

Disabling the Page Cache for the Current User

Disabling the page cache for the current user will cause the user to bypass the page cache for the current and subsequent requests. This is useful for testing or for logged-in users.

Segmenting the Page Cache

See Page Cache Segmentation for more information.

Purging a Specific URL

Purging for a Post or Term

Purging the Entire Page Cache

Warning: This will purge the entire page cache. This is a dangerous operation and should be used with caution.

Page Cache Segmentation

Page Cache Segmentation is used when you want to vary or differ the page response to different users. For example, you may want to show a different version of a page to logged-in users than to logged-out users. Or you may want to hide ads for users from a specific country. Segmenting the page cache allows you to do this in a performant way.

Registering a Group

To register a group, use the register_group() method:

Group names must be unique and must contain alphanumeric characters, dashes, and underscores only.

Adding a User to a Group

To add a user to a group, use the set_group_for_user() method:

The second parameter allows you to specify a segment within a group. For example, the group could be "logged-in" and the segment could be "digital subscriber". You could also have a different user in the "logged-in" group with the segment "print subscriber" to show a different version of the page to print subscribers.

Note: A user cannot be removed from a group once added at this time. If you need to remove a user from a group, you can add them to a different segment of the same group.

Checking if a User is in a Group or Segment

To check if a user is in a group or segment, use the is_user_in_group() method:

Testing Headers

The plugin supports faking the sending of headers sent through the plugin for testing purposes. To enable this, call the following code:

Once enabled, you can use the following methods to test headers being sent with the Alley\WP\WP_Page_Cache_Control\Concerns\Tests_Headers trait:

Usage: Front-end

The package has a front-end integration to allow for segmenting the page cache in-browser. This is enabled by default but can be disabled by using the wp_page_cache_control_enqueue_script filter.

Cache segmentation groups must be registered on the back end before they can be used on the front end. See Registering a Group for more information.

Types are available for TypeScript users:

npm install --save-dev @alleyinteractive/wp-page-cache-control

Testing

Run npm run test to run Jest tests against JavaScript files. Run npm run test:watch to keep the test runner open and watching for changes.

Run npm run lint to run ESLint against all JavaScript files. Linting will also happen when running development or production builds.

Run composer test to run tests against PHPUnit and the PHP code in the plugin.

Changelog

Please see CHANGELOG for more information on what has changed recently.

Credits

This project is actively maintained by Alley Interactive. Like what you see? Come work with us.

License

The GNU General Public License (GPL) license. Please see License File for more information.


All versions of wp-page-cache-control with dependencies

PHP Build Version
Package Version
Requires php Version ^8.0
alleyinteractive/composer-wordpress-autoloader Version ^1.0
mantle-framework/support Version ^0.11|^0.12|^1.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package alleyinteractive/wp-page-cache-control contains the following files

Loading the files please wait ....