Skip to main content
Drupal 8

Main navigation

  • Home
    • Question And Answer
    • NEWS
    • Projects
  • Tutorials - Drupal
    • Android
    • Other
User account menu
  • Log in

Breadcrumb

  1. Home

Cache

By editor , 26 November, 2020

Private Tempstore - Store data on Drupal 9 session

Tags

  • Drupal 8
  • Code
  • Drupal 9
  • Cache

This method allow to store data on drupal session using drupal session table (not php $_SESSION).
Storage is different for each users ans each visitors if anonymous

By editor , 26 November, 2020

Redis and Php-Redis with drupal 9 on Linux

Tags

  • Drupal 8
  • Settings
  • Drupal 9
  • Cache

Install Redis

sudo apt-get update && sudo apt-get upgrade
sudo apt install redis-server
sudo apt install php-redis

Check

sudo systemctl status redis-server
redis-cli ping

By editor , 17 September, 2017

Disable cache for a specific page

Tags

  • Drupal 8
  • Code
  • Cache
  • Module

Disable cache for a custom page from route declaration.

If you want to disable cache for a custom controller (Custom module), You have no_cache option (YOUR_MODULE.routing.yml).
Example :
File : mymodule.routing.yml

By editor , 24 April, 2017

Drupal 8 Cache contexts

Tags

  • Drupal 8
  • Code
  • Cache

Drupal 8 shiped with a powerfull cache API able to set cache according to a context. correct usage of this cache improve the site preformence greatly.

https://www.drupal.org/docs/8/api/cache-api/cache-contexts
https://www.drupal.org/node/2451661

By editor , 24 April, 2017

Memcache - Install memcached on linux and Drupal.

Tags

  • Drupal 8
  • Code
  • Cache
  • Server

Memcache is caching server allow you to incrise and have great performence on your site. Drupal and memcached work very well and here the full tutorial you need to install and setup memcache server and your drupal instance.

By editor , 25 October, 2016

Drupal 8 Cache API

Tags

  • Drupal 8
  • Code
  • Cache

Get the default cache bin

$cache = \Drupal::cache();

To get a particular cache bin (here 'render'):

$render_cache = \Drupal::cache('render');

By editor , 10 June, 2016

Cache Drupal 8 Render Arrays

Tags

  • Drupal 8
  • Code
  • Cache

Cache configuration of a renderer array (Just an exaple)

By editor , 7 June, 2016

Drupal 8 Tags based cache system

Tags

  • Drupal 8
  • Code
  • Cache
  • Module

This system allow you to invalidate drupal cache using a 'tag'

Exapples:

By editor , 25 May, 2016

Cache Clearing and rebuilding methods for Drupal 8

Tags

  • Drupal 8
  • Code
  • Server
  • Drush
  • Cache

Site URL

1. Go to Administration > Configuration > Development > Performance
 (/admin/config/development/performance)
2. Click on "Clear all caches"

By editor , 15 November, 2015

Create a simple module for Drupal 8 - Step 3 - Create Dynamic Page/ Block

Tags

  • Drupal 8
  • Module
  • Cache

In addition to the Step 2, Just add
    $form['#cache']['disabled'] = TRUE;
    $form['#cache']['max_age'] = 0;

 

Cache

Links

  • Drupal.org
  • Drupal core release cycle
  • Drupal events with ease
  • Unit test with Drupal using PHPUnit (Drupal 10)
  • Tokens for file upload url
  • Tips for Docker
  • CKEditor inline image files usage for custom forms.
  • Install Docker on Linux Mint
  • Install PHP 8.1
  • Drupal Security Best Practices
  • Order and sort items with tabledrag
  • Add a custom service YAML container
  • Apply a patch with composer