Caching

From EQdkp Plus
Jump to navigation Jump to search

This article describes how caching is done in EQdkp Plus since version 2.3

Points

Temp point values

  • current points (earned, spent, adjustments) are saved at the member table, points column
  • current APA points are saved at the member table, points_apa column

These values are temp values, and should be deleted and recalculated on raid, item, adjustment, or member changes. They reflect the current standing, so it can be used for direct display or further calculations.

APAs

  • APA values for items etc. are saved at the apa point table. So the calculation of APA can be done on the saved value, and not from the beginning. The value needs to be resetted if changes on value or date is done.
  • As stated before, the APA values of members are cached at the member_tables. Should be resetted if changes were made to items, raids etc.

Point History

To make the calculation of points easier, snapshots of the standings are written to the table member_points. So the calculation needs not to be done from the start, but based on the snapshots. The Snapshots will get deleted and recalculated, if there were changes made before the snapshot.

Data

  • Using PDC (Plus Data Cache)
$this->tags = $this->pdc->get('pdh_articles_tags');
if($this->tags !== NULL ){
//cache hit
return true;
}

$ttl = null; //Or 3600 for an hour
$this->pdc->put('pdh_articles_tags', $this->tags, $ttl);