1

Topic: TinyMCE Compressor 1.01 PHP Released

A new version of the gzip compression script is now released, this script compresses the overall download size of TinyMCE by 70% and budles together many HTTP requests to one large one so it loads a lot quicker.

This is a minor release and it fixes a bug when multiple init calls where used on a page. We are planing to add static disc cache support and port it to .NET and JSP in the near future but we are currently up to our ears with various other projects.

Best regards,
Spocke - Main developer of TinyMCE

2

Re: TinyMCE Compressor 1.01 PHP Released

Is it possible to use this release 1.01 together with an earlier version of TinyMCE - let's say rel. 1.45?

3

Re: TinyMCE Compressor 1.01 PHP Released

Yes, that should be possible. But I tested it agains 2.0, but since it simply loads and patches some functions that have been there for a long time I see no problem with that.

Best regards,
Spocke - Main developer of TinyMCE

4

Re: TinyMCE Compressor 1.01 PHP Released

spocke wrote:

Yes, that should be possible. But I tested it agains 2.0, but since it simply loads and patches some functions that have been there for a long time I see no problem with that.

You were right:-)
I've now implemented the 1.01 Compressor with my production TinyMCE 1.45 and it works.

5

Re: TinyMCE Compressor 1.01 PHP Released

After doing some more testing, I find out it doesn't work:-(

The language texts isn't expanded, at least not in ADVLINK.... In 2.0RC3 it works OK.

6

Re: TinyMCE Compressor 1.01 PHP Released

Regarding the cache part, since you are working with PHP you need to fix the etag in the header to prevent the browser from accually loading the file over and over again (by disk caching on the PHP end you dont have to read all the files over again, but the brwoser would still need to download the entire file since the etag isnt set).

However if you dont have experience with the etag you should be aware that PHP has had serious bugs with this, and this has just been fixed in the v4.4.0 release. You can read up on the bug here, I was going out of my mind until I stumbled across this one :

http://bugs.php.net/33057

By the way, the compressor works really well - looking at the Apache log when activated makes me smile everytime, big_smile

Mvh,
Kim Steinhaug
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
www.steinhaug.no - www.easywebshop.no - www.easycms.no

7

Re: TinyMCE Compressor 1.01 PHP Released

Yes I aggree, it would be better to use etags this way the browser would know if anything was updated since the last request. But I would then need to add some more logic for this such as getting the last updated file modification date of any of the plugins/langpacks etc and send that in etag format. I think this would be easier and better to do when I make a new version with diskcache support.

Then I would need to verify the modification dates of all files agains the cached .gz file so I could add the check for the etag values in that loop.

Thanks for the info regarding the bug issue and the feedback on this utillity. smile

Best regards,
Spocke - Main developer of TinyMCE

8

Re: TinyMCE Compressor 1.01 PHP Released

Well, working with the Etag is easier than you'd think. Since the cached .gz file would only be different if some of the files infact were changed, all you need to do is serve the cached file as you normally would and to a checksum on the whole file as a base for the Etag. Unless you have updated your .gz cache file, or that some files infact were changed so that the cached .gz file indeed changed, the checksum for the Etag will be the same - hence the browser sees the same Etag and skips downloading.

In my situation I dropped the Etag thingie, since only 10% of the servers our systems are deplyed on have PHP >= v4.4. Doing the disc cache you could use CacheLite from PHP Pear, excelent for that kind of task. With the correct kind of coffe you probably put it together in less than an hour if your familiar with the Cache Lite, however - finding those hours are not always that easy, I know, big_smile

9

Re: TinyMCE Compressor 1.01 PHP Released

Nah, is not a problem making the ETag feature it's just that it takes some time to get it right and as you say finding those hours is not that easy smile.

Regarding the cache issue, I think I will use a simple MD5 generation from the sum of the init string to get a valid cache key and use that for caching, I don't want to use third party software such as a cache class from Pear since it would tie me to that library and I tend to want to write all the stuff my self (if it's small enough), wouldn't like to write my own DOM parser or Browser wink, but writing all the stuff my self gives me more control over the logic if something goes wrong starts bugging out. I use the same method on TinyMCE I guess I lose time re-inventing the wheel but I gain time not needing to poke around and figure out whats wrong with the wheel when it's broken. But thanks for all the input, it's been realy inspiring.

Best regards,
Spocke - Main developer of TinyMCE