Coder Social home page Coder Social logo

Cache Report Data or Headers about php-reports HOT 3 CLOSED

jdorn avatar jdorn commented on August 10, 2024
Cache Report Data or Headers

from php-reports.

Comments (3)

jdorn avatar jdorn commented on August 10, 2024

Parsing headers is so quick right now, caching them will be more of a headache than it's worth.

The CACHE header should also bubble up from included reports. This is especially helpful for php reports that use an expensive api that doesn't change much. The header could be placed in the API include file.

This should also support explicitly disabling cache for a report. Useful when you need to override the cache settings from an included report.

CACHE: off

from php-reports.

jdorn avatar jdorn commented on August 10, 2024

Implemented caching for report rows. All report results are cached for 10 minutes, unless another value is specified with
the CACHE header.

Even though the result is cached by default, reports don't pull from this cached data unless one of the following is true:

  • The CACHE header is set to a positive number
  • The report format is CSV (no need to regenerate data just to do an export)

It will also use cached data in the following cases:

  • The report format is Chart (not implemented yet)
  • The report format is Email (not implemented yet)
  • A sorted or filtered report is being requested (not implemented yet)
  • A page of a paginated report is being requested (not implemented yet)

from php-reports.

edu-bob avatar edu-bob commented on August 10, 2024

Jeremy, you wrote

Even though the result is cached by default, reports don't pull from this cached data unless one of > the following is true:

The CACHE header is set to a positive number
The report format is CSV (no need to regenerate data just to do an export)

That second rule is not always a good idea. I have cron scripts that ONLY pull the CSV form of a report, and even with the option cache:0 in the header, I get stale data every time. I have to pull the report twice - once in HTML (sent to /dev/null) and then in CSV.

from php-reports.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.