CodeIgniter で Query Caching を作成する$this->db->cache_on();とcontroller+method、たとえばshow+73. しかし、テーブルから 73 の ID を持つ行を$this->db->cache_delete('show', $id);削除し、キャッシュを削除するために使用すると、それは機能しませんshow/73
。
私のコード:
結果を返す(モデル内)
public function temp($id)
{
$this->db->cache_on();
$this->db->where('id',$id);
$query = $this->db->get('system_store_table');
return $query->result();
}
テーブルから行とキャッシュを削除します。(テーブルから行を正常に削除しますが、キャッシュを削除できません)
public function delete($id = 0)
{
$this->db->flush_cache();
$this->db->where('id',$id);
$this->db->delete('system_store_table');
$this->db->cache_delete('show', $id);
if ($this->db->affected_rows() != 0)
return TRUE;
return FALSE;
}