RESTful Boost Cache

Component ID

2655858

Component name

RESTful Boost Cache

Component type

module

Maintenance status

Development status

Component security advisory coverage

not-covered

Component created

Component changed

Component body

Improve performance of REST data returned by Drupal's Web Services.

Motivation

Drupal tries to maximize performance by caching page requests, but it still must make a database call to retrieve even this cached data. For systems that cannot use a memory-based caching solution such as Varnish, the fastest way to return cached data is via files on the filesystem. This module writes REST API data to the filesystem, following the same principle as the Boost module.

Who should use this module

Use this module if...

  • You are using Drupal as a back-end REST server.
  • Traffic to your front-end is anonymous
  • Your content changes only infrequently (this limitation is a to-do improvement)

Planned Enhancements

This is a work-in-progress, and does not yet support cron-based cache expiry, URL whitelisted, or cache crawling. Those things may be added in the future. This module is not intended to become a full Drupal 8 implementation of Boost for static pages; its methodology, however, might serve as a guide for that type of implementation.

Installation & Usage

1. Install the module via the usual Drupal 8 procedures (via console:
drupal module:install restful_boost_cache ).

Screenshot of configuration page

2. Go to /admin/config/services/restful_boost_cache and set your cache directory, then copy the generated .htaccess rules to your Drupal root .htaccess file.

Any RESTful-generated json files will be written to the filesystem, and will be
served via the .htaccess rules, bypassing the Drupal bootstrap. If you do not
add the .htaccess rules, the json files will never be served.