Re: feature request : gzip caching

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



500Kb of the JS is my framework (which does a lot, you can see it when the
new encryption is done..)..
another 500Kb is things like the full sourcecode for jQuery..
so thanks, i'll use the minified jQuery in the next update.. :)

On Sun, Aug 28, 2016 at 2:45 AM, Aziz Saleh <azizsaleh@xxxxxxxxx> wrote:

>
>
> On Sat, Aug 27, 2016 at 8:37 PM, Ashley Sheridan <ash@xxxxxxxxxxxxxxxxxxxx
> > wrote:
>
>>
>>
>> On 28 August 2016 01:31:50 BST, Rene Veerman <
>> rene.veerman.netherlands@xxxxxxxxx> wrote:
>> >On Sat, Aug 27, 2016 at 9:36 PM, Joshua Kehn <josh.kehn@xxxxxxxxx>
>> >wrote:
>> >
>> >> Apache handles gzipping just fine. http://httpd.apache.org/
>> >> docs/current/mod/mod_deflate.html
>> >>
>> >> and my PHP handles static file serving only when needed, when
>> >evaluating
>> >> content and js for specific URLs
>> >>
>> >>
>> >> I'm not sure why that would be required. Why doesn't the HTML
>> >reference
>> >> the assets required directly?
>> >>
>> >
>> >
>> >that would result in *way* too many HTTP requests dude ;)
>> >
>> You're doing it wrong
>>
>> >i'm thinking i evaluate what URL is called up in PHP, figure out what
>> >cache
>> What's wrong with front end evaluating what js it needs to request, like
>> angular or react does?
>> >files are needed (i now use multiple stages of cache files for some
>> >stuff
>> >like the main HTML template), and output a new "master cache file" that
>> >is
>> >a file that gets called up rather quickly with readfile() after a
>> >file_exists(translateURLtoFilesystempath($untranslatedContentURL)) to
>> >see
>> >if regeneration for any particular URL is needed..
>> >
>> >public function translateURLtoFilesystempath ($url) {
>> >            $r = $url;
>> >            $r = str_replace('/','---',$r);
>> >            $r = str_replace('?','-_-',$r);
>> >            $r = str_replace('&','__-',$r);
>> >            $r = str_replace('=','___',$r);
>> >            return '--_'.$r;
>> >}
>> >public function translateFilesystempathToURL ($path) {
>> >            $r = preg_replace ('#.*--_#', '', $path);
>> >            $r = str_replace('---','/',$r);
>> >            $r = str_replace('-_-','?',$r);
>> >            $r = str_replace('__-','&',$r);
>> >            $r = str_replace('___','=',$r);
>> >            return $r;
>> >}
>> >
>> >
>> >
>> >
>> >>
>> >> and for noobish developers it might be very convenient to add this to
>> >php
>> >> readfile() afterall
>> >>
>> >>
>> >> Convenient and right are often two different ways to solve a problem.
>> >I
>> >> try to not offer convenient solutions that are not right.
>> >>
>> >
>> >yea, that's the C++ attitude ;) you do know C++ got dinosaured for a
>> >*more
>> >simple and intuitive* C# right? ;)
>>
>> That's not what happened at all. C++ is alive and well, C# has always
>> served a different purpose
>>
>> >
>> >>
>> >> --jk
>> >>
>> >> On Aug 27, 2016, at 3:04 PM, Rene Veerman <rene.veerman.netherlands@
>> >> gmail.com> wrote:
>> >>
>> >> yea ok.. "something upstream".. is that nginx easy to stack above /
>> >next
>> >> to / under apache2? i'm really used to apache2..
>> >> and for noobish developers it might be very convenient to add this to
>> >php
>> >> readfile() afterall..
>> >>
>> >> and my PHP handles static file serving only when needed, when
>> >evaluating
>> >> content and js for specific URLs to fit in a common HTML site
>> >template for
>> >> instance..
>> >> you know of a better way? i'm all ears :)
>> >>
>> >> On Sat, Aug 27, 2016 at 9:00 PM, Joshua Kehn <josh.kehn@xxxxxxxxx>
>> >wrote:
>> >>
>> >>> Why is PHP handling static file serving? This is squarely outside of
>> >it's
>> >>> domain. Have nginx or something upstream handle gzipping content.
>> >>>
>> >>> --jk
>> >>>
>> >>> > On Aug 27, 2016, at 1:22 PM, Rene Veerman <
>> >>> rene.veerman.netherlands@xxxxxxxxx> wrote:
>> >>> >
>> >>> > eh no, i'm a big fan of caching output in js / json cache files :)
>> >>> > but those still need to get gzipped... not just my main JS file,
>> >also my
>> >>> > photoalbum contents -> another 1Mb of JSON content...
>> >>> >
>> >>> > On Sat, Aug 27, 2016 at 7:19 PM, Ashley Sheridan <
>> >>> ash@xxxxxxxxxxxxxxxxxxxx>
>> >>> > wrote:
>> >>> >
>> >>> >>
>> >>> >>
>> >>> >> On 27 August 2016 17:52:48 BST, Rene Veerman
>> ><rene.veerman.netherlands@
>> >>> >> gmail.com> wrote:
>> >>> >>> Hi..
>> >>> >>>
>> >>> >>> First off, i love PHP. Many thanks for keeping it free too.
>> >>> >>>
>> >>> >>> However, i've noticed that gzipping the 1Mb of javascript that
>> >my
>> >>> >>> seductiveapps.com needs, takes a relatively long time (measured
>> >over
>> >>> a
>> >>> >>> total page load time which i'd like to bring down from it's
>> >current 10
>> >>> >>> seconds, about a second or even more is spent gzipping (by a
>> >core i5
>> >>> >>> machine))..
>> >>> >>
>> >>> >> Are you building the js each time it's requested? Have you
>> >thought
>> >>> about
>> >>> >> building it as a deployment step for production?
>> >>> >>
>> >>> >>>
>> >>> >>> At one time, i spent time building PHP code that cached the
>> >>> >>> already-gzipped
>> >>> >>> content and outputted that with just readfile().. But i never
>> >got it
>> >>> to
>> >>> >>> work a second time, unfortunately..
>> >>> >> Why don't you want the web server to handle the gzip side of
>> >things? It
>> >>> >> would make more sense surely?
>> >>> >>
>> >>> >>> Could you pretty please add this to the core of PHP? Shouldn't
>> >be that
>> >>> >>> hard
>> >>> >>> for the internals team right?..
>> >>> >>>
>> >>> >>> Many thanks in advance for even considering to do this..
>> >>> >>>
>> >>> >>> with regards,
>> >>> >>> Rene Veerman,
>> >>> >>> CEO + CTO of seductiveapps.com
>> >>> >>
>> >>> >> --
>> >>> >> Sent from my Android device with K-9 Mail. Please excuse my
>> >brevity.
>> >>> >>
>> >>>
>> >>
>> >>
>>
>> --
>> Sent from my Android device with K-9 Mail. Please excuse my brevity.
>>
>> --
>> PHP General Mailing List (http://www.php.net/)
>> To unsubscribe, visit: http://www.php.net/unsub.php
>>
>>
> Combine all of your JS to 1 file, minimize it and then serve it. After
> initial load it should be fine. That is how most systems I worked on with
> it and works fine. The browser won't have to download it multiple times
> (depending on user settings).
>
> 1MB of javascript is huuuuuge, I don't want to say you are doing it wrong,
> but something is going on. jQuery library itself is just 85kb compressed.
>
> As a developer, the way I do it is make sure that my architecture design
> is correct (which language/systems/etc.. to use). Once that is done for my
> purpose, the language usually doesn't matter.
>
>

[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux