Skip to content
Snippets Groups Projects
Commit 419f63cc authored by sarwan verma's avatar sarwan verma Committed by Artem Dmitriiev
Browse files

Issue #3462066 by sarwan_verma: Replace README.txt with README.md and update file format

parent 93358cac
No related branches found
No related tags found
1 merge request!3updated readme file
# serialization_cache Module
[Project Page](http://drupal.org/project/serialization_cache)
## Contents
1. [About](#about)
2. [Installation](#installation)
3. [Credits](#credits)
## About
The Drupal 8 serialization system is quite flexible but can be time-consuming when processing all entities recursively, including their fields and embedded entities. This module provides caching for normalized entities and embedded entities by using different caches for different accesses, such as checking "view" permissions for an entity and its fields.
## Installation
1. **Install the module**: Follow the standard installation instructions for Drupal modules. For detailed steps, refer to [Drupal Installation Guide](https://www.drupal.org/node/1897420).
2. **Override the serializer service**: The module overrides the default `serializer` service with `AccessCachingSerializer`. This is done automatically by the module. Alternatively, you can achieve this in your own module by implementing the `ServiceModifierInterface`. Here's an example:
```php
use Drupal\Core\DependencyInjection\ContainerBuilder;
use Drupal\Core\DependencyInjection\ServiceModifierInterface;
use Drupal\serialization_cache\AccessCachingSerializer;
class YourModuleServiceProvider implements ServiceModifierInterface {
public function alter(ContainerBuilder $container) {
if ($container->hasDefinition('serializer')) {
$container->getDefinition('serializer')->setClass(AccessCachingSerializer::class);
}
}
}
```
## Credits
For more information, visit the [project page](http://drupal.org/project/serialization_cache).
--------------------------------------------------------------------------------
serialization_cache module Readme
http://drupal.org/project/serialization_cache
--------------------------------------------------------------------------------
Contents:
=========
1. ABOUT
2. INSTALLATION
3. CREDITS
1. ABOUT
========
Drupal 8 serialization system is pretty flexible but it causes serious time cost
to recursively process all entities, their fields, embed entities if they are
exist and etc.
This module provides caching for normalized entities (+embedded entities)
using different caches for different accesses (checking "view" for entity and
its fields).
2. INSTALLATION
===============
First step: install as usual, see https://www.drupal.org/node/1897420 for
further information.
Second step: you need to override your current "serializer" service with the
AccessCachingSerializer. This module already does it.
Alternatively you can do it like so in your own module:
class YourModuleServiceProvider implements ServiceModifierInterface {
public function alter(ContainerBuilder $container) {
if ($container->hasDefinition('serializer')) {
$container->getDefinition('serializer')->setClass(AccessCachingSerializer::class);
}
}
}
4. CREDITS
==========
Project page: http://drupal.org/project/serialization_cache
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment