Welcome Guest, Not a member yet? Register   Sign In
Caching Information
#1

[eluser]newsmuncher[/eluser]
Is it possible to get the file name of the related cached page and the time its due for refreshing?
#2

[eluser]newsmuncher[/eluser]
If you have database caching on at the same time as page caching, i take it that the query's don't re-run and the page cache gets loaded?

Another thing ive noticed, database query caching is on and ive got a query retrieving a username from a table based on an id. If i update the username from within phpMyAdmin the username is instantly updated on the site, how does the database caching work exactly? The statement doesn't change, so how would CodeIgniter know that it changed?
#3

[eluser]cideveloper[/eluser]
[quote author="newsmuncher" date="1294530899"]Is it possible to get the file name of the related cached page and the time its due for refreshing?[/quote]

From the output library. This can be stuck in your controller if you want

Code:
$CI =& get_instance();
        $uri =    $CI->config->item('base_url').
                $CI->config->item('index_page').
                $CI->uri->uri_string();
        
        $cache_file_name = md5($uri);

the expiry is located in the cache file before "TS--->"

Quote:Another thing ive noticed, database query caching is on and ive got a query retrieving a username from a table based on an id. If i update the username from within phpMyAdmin the username is instantly updated on the site, how does the database caching work exactly? The statement doesn’t change, so how would CodeIgniter know that it changed?

I don't think the above is true. Are you sure you aren't changing the query in some way?
#4

[eluser]Unknown[/eluser]
I wrote an article about caching in CodeIgniter recently, it may be worth a read for you. Also I use a little helper for dealing with output cache that has just what you're looking for.

bitbucket.org/stevenbenner/codeigniter-cache-helper/

Quote:database query caching is on and ive got a query retrieving a username from a table based on an id. If i update the username from within phpMyAdmin the username is instantly updated on the site

You are either evicting the cache, running a query that changes or query caching isn't actually running. Remember that query caching wont do anything unless you turn on the cache_on flag AND set cachedir to a writable directory.
#5

[eluser]newsmuncher[/eluser]
Query cache is turned on and the directiory is set correctly, I haven't altered the query or page in any way, but from phpMyAdmin if i change the username related to the id i want, the cache recognizes this and changes it. I know the query is being cached because if i manually delete the cached query's it generates them again and places them in the cached folder.

I can't understand why, only explanation i suppose would be that its running the query and caching it on every page load, which is pointless....
#6

[eluser]Unknown[/eluser]
Got a question on DB Caching (sorry if I should already know this...)

I have a DB with 500K+ rows and is really used for look up, a lot, but from many users across. So, it isn't really tied to a particularly long session (the time of the query really)

So, my question is -> Is the cache file created when a user creates a session, and is for the life of the session OR, is that cache available to ANYONE on that particular server?

Use case -> Mobile Device needs to check for an item in a list before it can proceed. It passes that item via the web page and the return is a yeah or nay. The list changes once a day or once a week even, so it would be a great candidate to live in a cache, but i don't want or need to cache it if it is tied to a one time request.




Theme © iAndrew 2016 - Forum software by © MyBB