Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:99577 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 2417 invoked from network); 20 Jun 2017 17:24:53 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 20 Jun 2017 17:24:53 -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.4 as permitted sender) X-PHP-List-Original-Sender: francois@tekwire.net X-Host-Fingerprint: 212.27.42.4 smtp4-g21.free.fr Received: from [212.27.42.4] ([212.27.42.4:30736] helo=smtp4-g21.free.fr) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 4E/C4-13828-36A59495 for ; Tue, 20 Jun 2017 13:24:52 -0400 Received: from [172.16.0.26] (unknown [158.255.108.131]) (Authenticated sender: flaupretre@free.fr) by smtp4-g21.free.fr (Postfix) with ESMTPSA id 2C1FD19F5EA; Tue, 20 Jun 2017 19:24:44 +0200 (CEST) To: =?UTF-8?B?5rGf5rmW5aSn6Jm+5LuB?= , Internals References: <1e99c642-e3b8-3445-82ac-f6cb6258e0b4@php.net> <4ef58012-ad0d-4a7b-c558-159a670d2d40@tekwire.net> Message-ID: Date: Tue, 20 Jun 2017 19:24:41 +0200 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.2.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: fr Subject: Re: [PHP-DEV] [RFC][VOTE] Add support for stream-wrapped URLs inopcode cache From: francois@tekwire.net (=?UTF-8?Q?Fran=c3=a7ois_Laupretre?=) Hi, Le 20/06/2017 à 18:35, 江湖大虾仁 a écrit : > Hi François, > Good work, but I'm not sure if I missed something because I didn't > find any discuss relating to this RFC in my mail box, as well as the > PR on GitHub. I have a question about the detail of `cache_key`: Discussion : http://www.serverphorums.com/read.php?7,1505444 > > If the method is not defined, every path associated to this wrapper > are non-cacheable. In order to avoid key value conflicts, the returned > key must start with the same '://' prefix as the input path. > If it not the case, an error is raised and the key is ignored. > > Why don't we simply ask `cache_key` to provide the path, and we > combine it with scheme in the core? It's much easier for userland to > implement this feature since there is less limits, and we didn't need > to worry about the key conflicts between different stream-wrappers any > more. 1. The userspace code needs to get the full URL as input, as a stream wrapper may be associated with more than one scheme. 2. In the most usual case where the input URL is to be used as key, I cannot ask developers to compute the returned path by removing the '://' prefix from the input URL. The API is much easier to understand if they just return the input URL. It is also faster in this case because the PHP function/method returning its input argument won't even duplicate the data (it will just increment the zend_string reference count). Regards François