Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:81620 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 92287 invoked from network); 2 Feb 2015 17:31:16 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 2 Feb 2015 17:31:16 -0000 Authentication-Results: pb1.pair.com smtp.mail=francois@tekwire.net; spf=softfail; sender-id=softfail Authentication-Results: pb1.pair.com header.from=francois@tekwire.net; sender-id=softfail Received-SPF: softfail (pb1.pair.com: domain tekwire.net does not designate 212.27.42.2 as permitted sender) X-PHP-List-Original-Sender: francois@tekwire.net X-Host-Fingerprint: 212.27.42.2 smtp2-g21.free.fr Received: from [212.27.42.2] ([212.27.42.2:8159] helo=smtp2-g21.free.fr) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id A2/7C-34915-464BFC45 for ; Mon, 02 Feb 2015 12:31:16 -0500 Received: from moorea (unknown [82.240.16.115]) by smtp2-g21.free.fr (Postfix) with ESMTP id 723034B02BC; Mon, 2 Feb 2015 18:28:03 +0100 (CET) Reply-To: To: "'Rasmus Lerdorf'" , References: <008b01d03f06$bc8e9940$35abcbc0$@tekwire.net> <54CFAAA5.6050700@lerdorf.com> In-Reply-To: <54CFAAA5.6050700@lerdorf.com> Date: Mon, 2 Feb 2015 18:31:11 +0100 Message-ID: <00ac01d03f0e$09a0ce90$1ce26bb0$@tekwire.net> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable X-Mailer: Microsoft Outlook 14.0 Thread-Index: AQFX7Xg2OtZN3lyuxp3N4vgO3eqARwHgw/C+nb8y2vA= Content-Language: fr X-Antivirus: avast! (VPS 150202-0, 02/02/2015), Outbound message X-Antivirus-Status: Clean Subject: RE: [PHP-DEV] [VOTE] Add is_cacheable() stream-wrapper operation From: francois@tekwire.net (=?iso-8859-1?Q?Fran=E7ois_Laupretre?=) > De=A0: Rasmus Lerdorf [mailto:rasmus@lerdorf.com] > Doesn't this imply that "path" is the one true cache key? There are = some > issues with that which we will have to address at some point. For > example, when running fpm chrooted you need more than the path. We'll > likely need a more APC-like option here to use the device+inode for = the > key. It seems like a generic mechanism like you are proposing needs to > take this into account and provide some mechanism that tells the = opcode > cache how to determine uniqueness. Perhaps that is simply encoded into > the path parameter, but then maybe it should have a more appropriate > name. Yes, it implies that the path is the cache key. It implies that the = stream wrapper has a way to build unique and reproducible paths (PHK, for = instance, builds a unique ID from (dev/inode/mtime) when opening a package and = builds its paths from this ID). My first idea was to add a 'cache_key' element in the stream_stat() = result. This element would be a binary string to use as key. This way, the = stream wrapper can return a path, a dev/inode/mtime concatenation, etc. If we = don't want to modify the stat() result, we can define a 'cache_key' hook in php_stream_wrapper_ops. I reverted to a system where path is considered as unique because I = thought my original idea would be considered as too complex. And using the path = as key was enough for phar and phk. But I agree, it is not a good solution = for 'file:', which should be cached by dev/inode/mtime. I put the vote in standby. Cheers Fran=E7ois