Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:81682 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 24842 invoked from network); 3 Feb 2015 06:40:20 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 3 Feb 2015 06:40:20 -0000 Authentication-Results: pb1.pair.com header.from=pierre.php@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=pierre.php@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.216.42 as permitted sender) X-PHP-List-Original-Sender: pierre.php@gmail.com X-Host-Fingerprint: 209.85.216.42 mail-qa0-f42.google.com Received: from [209.85.216.42] ([209.85.216.42:47094] helo=mail-qa0-f42.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 5E/A0-20608-45D60D45 for ; Tue, 03 Feb 2015 01:40:20 -0500 Received: by mail-qa0-f42.google.com with SMTP id dc16so32569932qab.1 for ; Mon, 02 Feb 2015 22:40:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=VCQ5IU2mxCd2EvgIka1/ttY/FDh5v3rv9kk6Fm/YOYY=; b=QRcLvG+Jc4mddyFouF3SortpVuHTWYHuZS+qdsHaX55rRSSSoJOOcDChB5D4CuU2mO QzOnJAN4vVT0QPPd+lI8ABR1I8fp276s/hJBa+8Xn1irteVolfdwvTRCYZQ3ak0SqU4c 4fbTJxQXCzXJEzUrp/n3PrzOGtu9jw1LdM/ncjKDYJAwiIXfxZoA9hnJ9G9OxFryv4DT P78AzOj/WgW8JoaHHKF7DzNOgZ9BS/7MQIx/AOZMJBkXQOgz8eXywkYSW5THgizDyvCv CHPYyhxNcUdyIvAla7Q2RHVnx0OezZtIMToa9EJyEH9eZQoJmyvXY/n6rfrdhGSAefgE 76Ig== MIME-Version: 1.0 X-Received: by 10.224.113.200 with SMTP id b8mr47930350qaq.35.1422945618150; Mon, 02 Feb 2015 22:40:18 -0800 (PST) Received: by 10.96.3.168 with HTTP; Mon, 2 Feb 2015 22:40:17 -0800 (PST) Received: by 10.96.3.168 with HTTP; Mon, 2 Feb 2015 22:40:17 -0800 (PST) In-Reply-To: <00ac01d03f0e$09a0ce90$1ce26bb0$@tekwire.net> References: <008b01d03f06$bc8e9940$35abcbc0$@tekwire.net> <54CFAAA5.6050700@lerdorf.com> <00ac01d03f0e$09a0ce90$1ce26bb0$@tekwire.net> Date: Tue, 3 Feb 2015 13:40:17 +0700 Message-ID: To: =?UTF-8?Q?Fran=C3=A7ois_Laupretre?= Cc: Rasmus Lerdorf , PHP internals Content-Type: multipart/alternative; boundary=047d7bea30cc1aca8d050e295804 Subject: RE: [PHP-DEV] [VOTE] Add is_cacheable() stream-wrapper operation From: pierre.php@gmail.com (Pierre Joye) --047d7bea30cc1aca8d050e295804 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On Feb 3, 2015 12:31 AM, "Fran=C3=A7ois Laupretre" w= rote: > > > De : Rasmus Lerdorf [mailto:rasmus@lerdorf.com] > > Doesn't this imply that "path" is the one true cache key? There are som= e > > 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 strea= m > 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 am not a big fan of putting this info on the path. A path must remain a path or URI, not some random generated string, requiring to be parsed to get the actual path. A cache key sounds cleaner, easier to implement and valid. --047d7bea30cc1aca8d050e295804--