Manage CacheGenerate and CachePurge via services, add web auth credentials, improve cache warming, phpcs and drush commands

Created on 24 November 2022, over 1 year ago
Updated 28 May 2023, about 1 year ago

Problem/Motivation

  • The "Cache-Warmer" class BoostCacheGenerate won't work with password protected web space. Especially on test systems it is helpful to use web auth auth credentials.
  • There are currently no drush commands and services defined for purge and generate classes.
  • The logic to and generate cache files including batch config are currently managed directly in config form class.
  • There are currently some hard coded values e.g. cache file folder and chunk size.

Steps to reproduce

Regarding the auth problematic: Just try to use Function "Generate all boost cacheable pages" on a protected web space. Currently you just see no result (additional files) in boost cache folder.

Proposed resolution

The Guzzle library can deal with username and password. I already have a proof of concept. We just need to handle the credentials through config values. So they can be set dynamically via settings.php on automated test systems.
I think we can just create this logic: When both variables are set use them in guzzle via an if condition. I think we don't need an additional switch boolean.
Create services and write drush commands.

Remaining tasks

User interface changes

Additional entities in config form as described above.

API changes

No.

Data model changes

No.

📌 Task
Status

Fixed

Version

1.0

Component

Code

Created by

🇩🇪Germany C-Logemann Frankfurt/M, Germany

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • 🇧🇪Belgium nonom Brussels

    Enabling the module via drush I'm getttng this error:

    In CheckExceptionOnInvalidReferenceBehaviorPass.php line 86:
      The service "boost.command" has a dependency on a non-existent service "logger.channel.linkchecker".
  • Status changed to Needs work over 1 year ago
  • 🇩🇪Germany C-Logemann Frankfurt/M, Germany

    Oh that's a bad copy paste error. Will fix this soon. Until then code should be work when also linkchecker module is installed.

  • Status changed to Needs review over 1 year ago
  • 🇩🇪Germany C-Logemann Frankfurt/M, Germany

    I use a clone of a bigger drupal system especially because of performance improvements. Now I installed a vanilla Drupal beside to avoid errors like this. The logger bug is now fixed with last commit.

  • 🇧🇪Belgium nonom Brussels

    That are good news!, back to review!

    Just a suggestion. I've noticed the site is in maintenance mode generating all the URLs in the batch proccess. Maybe we would like to avoid this; because if it fails, the site still in maintenance.

  • 🇧🇪Belgium nonom Brussels

    I did a full review over the options

    - Boost Path Cacheability Settings
    If I hide the following page:

    Still being generated but not served which is good.

    - The count pages doesn't works for me but not a big issue at all.
    - The Purge is working from my side.
    - The Generate all pages probably is not fulling working, get in mind the feedback messages which aren't clear at all.
    - I did not tested the XML sitemap options there are many settings features involved on this branch.

    By other side,

    The multilingual seems working but seems not working fully caching pages without the multilingual feature.

    I think we have many options to test so an alpha version could help to start contributing on.

    By other side thanks for the full classes documentation they looks so fine :)

    @C-Logemann Could I work on the same branch ?

  • 🇧🇪Belgium nonom Brussels
  • Issue was unassigned.
  • Status changed to Needs work over 1 year ago
  • 🇧🇪Belgium nonom Brussels
  • 🇩🇪Germany C-Logemann Frankfurt/M, Germany

    @nonom Sorry for the delay. AFAIK it should be possible for you to work on the same branch. And in any case this would be OK for me.

  • Assigned to nonom
  • 🇧🇪Belgium nonom Brussels
  • 🇩🇪Germany C-Logemann Frankfurt/M, Germany

    @nonom I wanted to move on a little bit this weekend especially with this issue. So thanks for your review so far. I know that the reporting of the cache warming parts are not very consistent. But that is not a blocker to merge the major improvements.

    > I noticed the site is on maintenance mode starting the "Generate all the URLs" batch process.

    Oh I didn't recognized this. And I agree we should fix this. When it's an easy fix I will directly include it. If not we can open a new issue for that.

  • Assigned to C-Logemann
  • 🇩🇪Germany C-Logemann Frankfurt/M, Germany

    I tested again especially the sitemap part and I think everything what's left is only a minor problem. So I will finally merge the current code because it's better as without. So let's create extra issues on the other minor points.

    Some response from my to today test:

    1. I cannot reproduce the Maintenenace problem.
    2. The page count currently don't work for one file for me.
  • Open on Drupal.org →
    Core: 9.5.x + Environment: PHP 7.4 & MySQL 5.7
    last update about 1 year ago
    Waiting for branch to pass
  • Open on Drupal.org →
    Core: 9.5.x + Environment: PHP 7.4 & MySQL 5.7
    last update about 1 year ago
    Waiting for branch to pass
  • @c-logemann opened merge request.
  • Open on Drupal.org →
    Core: 9.5.x + Environment: PHP 7.4 & MySQL 5.7
    last update about 1 year ago
    Waiting for branch to pass
    • C-Logemann committed ece89786 on 8.x-1.x
      Issue #3323668 by C-Logemann, nonom: Manage CacheGenerate and CachePurge...
  • Status changed to Fixed about 1 year ago
  • 🇩🇪Germany C-Logemann Frankfurt/M, Germany
  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.69.0 2024