Problem/Motivation

Varnish cache doesn't deal with max-age, so it may cache the embed tokens past their expiration date.

Steps to reproduce

Set up Varnish to cache pages for 6 hours, notice that for anonymous users the Power Bi reports stop working after an hour.

Proposed resolution

Add a sub-module that deals with the case where varnish is used and purges the varnish cache tags associated with pwbi elements on cron.

Remaining tasks

  1. proof of concept
  2. refinement
  3. commit and release
  4. celebrate

User interface changes

A new module with a configuration form.

API changes

none

Data model changes

none

Issue fork pwbi-3571697

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

bircher created an issue. See original summary.

bircher’s picture

Status: Active » Needs review

The MR contains a modified version of what we implemented in a project.
That said the code here is untested. Nevertheless I think this can be reviewed.

bircher’s picture

The MR now contains tests

bircher’s picture

Issue summary: View changes

Ok! This is now completely ready for review and merging.
It has tests, a configuration form, works on Drupal 11 and 10. It is a drop-in solution you just turn on the module and configure how often cron runs and no other changes are needed for varnish or other caching mechanisms to start working and serving anonymous users power bi reports without stale embed keys.

bircher’s picture

a small note on the pipeline: I didn't make cspell eslint etc green because I saw that the MR for #3515944: Allow defining credentials in settings.php already does.

enriquelacoma’s picture

Assigned: Unassigned » enriquelacoma

The changes work as intended

enriquelacoma’s picture

Status: Needs review » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

enriquelacoma’s picture

Status: Fixed » Closed (fixed)
iuliad’s picture

Hello, this patch cannot be applied on the released 2.0.3. version (error: patch failed: src/Plugin/Oauth2Client/PwbiServicePrincipal.php:33), it's only applicable on the 2.x version, right? Thanks in advance!

enriquelacoma’s picture

Hello, you are right #iuliad we intend to release a new version soon