Home  |  Linux  | Mysql  | PHP  | XML
From:David Sklar Date:Wed May 14 09:39:31 2008
Subject:apc_delete_file() ?
I'd like to add a function that removes a specific compiled file from
the cache. My initial thought is to have the function, given a
filename:

- use apc_cache_make_file_key() to determine the cache key for the filename
- use apc_cache_find_slot() to determine the slot for the cache key
- call remove_slot() on the slot to either free it immediately or put
it on the deleted list if its refcount is > 0
- and optionally have the function call process_pending_removals() to
flush the deleted list (if possible)

Another possibility, more useful for bulk deletes (at least on
fullpath entries) could be something like apc_delete_file($pattern)
which deletes all files whose names match a given pattern.  This could
work internally like apc_cache_clear() except that before calling
remove_slot() on  a particular slot, it would compare the pattern to
the fullpath in the key and only remove if it matches.

Do either/both of these approachese sound reasonable? Something
obvious I'm missing?

Thanks,
David
Navigate in group php.apc.dev at sever news.php.net
Previous Next




  
© No Copyright
You are free to use Anything
Site Maintained by Zareef Ahmed
Powered By PHP Consultants