Welcome Guest, Not a member yet? Register   Sign In
[KLUDGE] Solved: Cache ignoring inputs from form file
#1

[eluser]John_Betong[/eluser]
 
I recently added caching to a site and came across the form problem which accepts input but the results are ignored (due to finding a previously stored cache file).

Extensive forum searching revealed some involved and complicated solutions. I dug into the core files and found the following code. I thought that if the relevant form file is not written (cached) then problem solved.

The common condition to check if the form file is to be cached is an empty($_POST).

Here is the KLUDGE that requires your comments:

CI2.0 file: ./system/core/output.php - lines: 224...231
Code:
// --------------------------------------------------------------------
  // Do we need to write a cache file?
  // original code: if ($this->cache_expiration > 0)
  // added:   AND empty($_POST)
  if ($this->cache_expiration > 0 AND empty($_POST))
  {
    $this->_write_cache($output);
  }
 
 
 




Theme © iAndrew 2016 - Forum software by © MyBB