As many of the reports may take longer to run. We need to add the ability to control which reports are cached. Report writers should be able to control the cache duration, and whether caches are maintained per user, per role and/or per document type (it is possible to have report outputs vary per document type).

We also need a way to force the rebuild of the cache for an individual report.

Comments

metzlerd’s picture

This has been implemented and will be available in the 7.x-4.x documentation. I did not implement cache per role as it didn't seem to make sense as a user could have more than one role, so the version. To test this download the 7.x-4.0-alpha1 release. Caching is not enabled by default but must be enabled on a per report basis.

metzlerd’s picture

Status: Active » Needs review
metzlerd’s picture

Version: 7.x-4.x-dev » 7.x-4.0-alpha1
Pierre.Vriens’s picture

David, I'm not sure I understand the actual feature/functionality here. Assuming one knows what caching in vanilla Drupal is all about (like the 'flush all caches', or 'clear theme caches', etc), can you explain a bit about what this new features is about? Also, I guess that there is no relationship to the "clear cach" option in the forena admin area, correct?

Some related questions:
- Do you have any details (stats or something) about real world cases for this?
- If this is something you documented somewhere else already, can you tell where to find that?
- About testing this caching feature, can you give a few details about a good case for such testing?

metzlerd’s picture

There are some docs in the Report Writers guide on the feature.

Basically if you visit the layout page there are some new caching options so that you can set where you specify the cache duration per report, and whether the cache created is generated on a per user basis or per doc type (or both). It is useful for reports that take longer to generate so that you aren't doing complex analytical queries in the report.

The reason that this was generated is that some folks are using forena for some pretty hefty analysis. They run group by queries that give sums/aggregates for 10's of thousands of rows, and these reports had a render time of about 3-5 seconds (mostly the SQL run time). That's a bit slow and the data was changing slowly, so the idea was to create cached versions of the reports so that server wasn't overly taxed.

Incidentally ,the cache is good for all document types of the report, so if you set the cache for 5 minutes or so you'd speed up the rendering time of the CSV exports or PDF generations.

Another feature that comes along for the ride is a custom report context. You can now reference {report.time} anywhere in the report to display the render time of the report. This will be useful for these types of reports because you may want to include an "as of {report.time}" in your report so that users know that they are working in stale data.

Drupal normally only caches for anonymous users, but this cache mechanism works for all users.

Hope that helps.

Pierre.Vriens’s picture

Now I get it, Thanks for the explanation! Seems like it'll make sense also for some of our data blocks in XML format (eg containing information about mainframe software components), whereas we're sometimes talking about 100's of thousands (not just 10's ...) components ... And for legal reasons such information has to remain available for reporting (IT auditors ...) for like 7 to 10 years "after its last update" (do the math ...).

metzlerd’s picture

Issue summary: View changes
Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.