Add more durations to drop-down

Created on 24 September 2020, about 4 years ago
Updated 28 September 2023, about 1 year ago

Problem/Motivation

With tag-based caching, desired cache lifetimes may be very long. Longer than one day.
With a CDN having local points of presence we might prefer a short browser lifetime of less than one minute.

Steps to reproduce

Not applicable

Proposed resolution

As per patch

Remaining tasks

-

User interface changes

-

API changes

-

Data model changes

-

Feature request
Status

Active

Version

2.0

Component

Code

Created by

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

Merge Requests

Comments & Activities

Not all content is available!

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

  • 🇧🇪Belgium BramDriesen Belgium 🇧🇪

    Hmm, why not add a checkbox under a accordeon box "Expert settings" that enables those options?

    There are already other modules altering the list like Purge to actually add a good handful of the options added here.

  • Status changed to Needs review about 1 year ago
  • 🇧🇪Belgium BramDriesen Belgium 🇧🇪

    Also did a bit of cleanup:
    - Code style
    - There was a setting being set, but it was not present in the form, so I removed it
    - Unused import removed

  • 🇧🇪Belgium BramDriesen Belgium 🇧🇪

    Also fixed the schema's

  • 🇳🇿New Zealand Josh Waihi

    Thanks for the contributions @BramDriesen,

    Hmm, why not add a checkbox under a accordeon box "Expert settings" that enables those options?

    I am making an assumption here that if you're expert enough to fine tune cache control, you're also exporting config to code (e.g. with drush config:export). And as such, you could manipulate the settings in code there and bypass the form UI. But that does render the UI completely unhelpful so I am open to your suggestion to make the UI support an expert mode.

    That mode should probably transform the field inputs from drop down options to integer fields where the expert can arbitrary set the TTL in seconds. Though presents might be still helpful for the expert, having presents only in the form of dropdowns would be too restrictive.

  • Status changed to Needs work about 1 year ago
  • 🇧🇪Belgium BramDriesen Belgium 🇧🇪

    How about an additional checkbox for that conversion (in a separate issue)?

    I am making an assumption here that if you're expert enough to fine tune cache control, you're also exporting config to code (e.g. with drush config:export). And as such, you could manipulate the settings in code there and bypass the form UI. But that does render the UI completely unhelpful

    Correct, and it's that last part I'm worried about. Since e.g. if a developer leaves, a new person joins the team, or someone from the client that knows a bit about Drupal and caching and happens to look at the config screen, they will have questions. As the values are not shown/matching with what they see on the front-end.

  • 🇳🇿New Zealand Josh Waihi

    How about an additional checkbox for that conversion (in a separate issue)?

    The ideal experience would be one where you could enable expert mode (e.g. toggle slider?) in the UI and without reloading the page, the form converts drop downs into integer inputs. That would likely require some form AJAX work so Drupal could rebuild the form with new input type for the form elements.

    In lieu of that, a checkbox for export mode and a submission of the form to rebuild the form with integer inputs would work too.

    I think we can do that in this issue and you can amend your current MR :)

  • 🇧🇪Belgium BramDriesen Belgium 🇧🇪

    Tagging for Drupalcon to sprint on this

  • 🇦🇺Australia dpi Perth, Australia

    This is older and has more issues.

  • First commit to issue fork.
  • Status changed to Needs review 11 months ago
  • 🇧🇪Belgium dieterholvoet Brussels

    I added an AJAX-based expert mode that isn't stored it config, it just toggles the max-age inputs between dropdowns and number inputs.

  • Pipeline finished with Skipped
    16 days ago
    #357526
  • Status changed to Fixed 16 days ago
  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.71.5 2024