Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Re: rvm_css (v1.2)
Ruud I’m having a slight problem with the plug-in. My host server uses PHP4 by default and I have been quite happy to use it this way up to now, but I decided this morning to switch to PHP5 which is available via the .htaccess rule AddType application/x-httpd-php5 .php
. Once I had switched, on the “Style” tab when saving a style sheet I get the following at the bottom of the page:-
Warning: fopen(/home/thebombs/public_html/css/default.css) [function.fopen]: failed to open stream: Permission denied in /home/thebombs/public_html/textpattern/lib/txplib_misc.php(571) : eval()'d code on line 72
Warning: fwrite(): supplied argument is not a valid stream resource in /home/thebombs/public_html/textpattern/lib/txplib_misc.php(571) : eval()'d code on line 73
Warning: fclose(): supplied argument is not a valid stream resource in /home/thebombs/public_html/textpattern/lib/txplib_misc.php(571) : eval()'d code on line 74
And it seems not to be changing the files in the CSS folder. Any way around this?
Stuart
In a Time of Universal Deceit
Telling the Truth is Revolutionary.
Offline
Re: rvm_css (v1.2)
Stuart, it seems that you do not have permission to open ‘/home/thebombs/public_html/css/default.css’. The other two errors are a result of that.
Offline
Re: rvm_css (v1.2)
Yes I thought it was permissions so I’ve been experimenting a bit. I noticed via FTP that the owner for the CSS files (there are 4 of them) was set to 99 99 rather than to me and using PHP5 I couldn’t delete them. I reverted back to PHP4 and first downloaded the files to my PC. I then deleted the files on-site and re-uploaded them again via FTP. Doing a refresh showed them as belonging to me. I deleted one of them and then I went into txp admin and re-saved it from there. Checking via FTP showed that it had been saved as 99 99 again. The other 3 files that I had re-uploaded and left in place, when I re-saved those via TXP admin they remained as belonging to me.
I’ve reverted back to PHP5 again and all seems well but it would seem there might be a problem with ownership when saving a new file with the plug-in active. Any thoughts?
Stuart
In a Time of Universal Deceit
Telling the Truth is Revolutionary.
Offline
Re: rvm_css (v1.2)
The plugin doesn’t set file ownership. That purely depends on how your webserver software calls the PHP binary which in turn executes the TXP PHP script (and plugins).
Offline
Re: rvm_css (v1.2)
OK thanks Ruud. Looks like a couple of emails are in order. ;)
Stuart
In a Time of Universal Deceit
Telling the Truth is Revolutionary.
Offline
Re: rvm_css (v1.2)
Hi Ruud and everyone,
I’ve been trying to get this to work with the CSS compression directions here.
I am using those directions for compressing javascript, and I thought maybe compressing and cacheing together would provide the best optimization for css.
So far, I have been unsuccessful. Anyone have any thoughts?
No matter what, thanks for the great plugin!
Swim Kitten, A Magento Site
When nothing but incredibly revealing dresses and swimwear will do
Offline
Re: rvm_css (v1.2)
Raina, those compression techniques turn the CSS file into a PHP file. My plugin was written to achieve the exact opposite: being able to serve the CSS file as a static file instead of using PHP to increase performance.
You don’t need PHP to compress CSS. Your webserver can do this by itself if configured to do so. Depending on which webserver software you use, a different technique is needed: mod_gzip (apache 1.3.x), mod_deflate (Apache 2.x), mod_compress (lighttpd)
Offline
#56 2008-03-02 22:08:22
- masa
- Member
- From: Asturias, Spain
- Registered: 2005-11-25
- Posts: 1,091
Re: rvm_css (v1.2)
ruud wrote:
You don’t need PHP to compress CSS.
I’m wondering though, does compression really make any noticable difference to the end users except for in edge cases? Is it worth the gain seeing as external css is cached and hence won’t need to be downloaded again on subsequent page loads?
Offline
#57 2008-03-02 22:26:01
- TheEric
- Plugin Author
- From: Wyoming
- Registered: 2004-09-17
- Posts: 566
Re: rvm_css (v1.2)
Compression helps with the speed of delivery. Really though, the benefits of compression are experienced by the host as there is overall. Less data sent per visitor equals a lot less as compared to all the monthly visitors as it relates to any bandwidth quota.
Offline
Re: rvm_css (v1.2)
And strange as it may seem, although the actual compressing takes up some CPU time, it can reduce the server load for two reasons:
- The files are served faster and the corresponding child process of the webserver that is needed to serve the file is available more quickly to serve another file, because compressed (=shorter) files take less time to be transmitted to the visitor. When your webserver is memory-limited instead of CPU limited, using compression can help a lot. The webserver child processes are used more efficiently.
- Network traffic generates interrupts which have to be handled by the kernel and cost CPU time. Compression reduces traffic and the amount of interrupts involved. This lowers the CPU time spend handling interrupts, which (so I’ve read) can outweigh the additional CPU load caused by compressing.
But as Eric says, one of the main benefits is cost reduction. After I added compression for static files on a server that I manage, bandwidth usage dropped 30-40%. Most of the websites involved contained mostly text, not a lot of images. That reduction was enough to avoid paying $135 extra each month (!) for additional bandwidth.
Offline
Re: rvm_css (v1.2)
ruud wrote:
And strange as it may seem, although the actual compressing takes up some CPU time, it can reduce the server load…
Makes sense. Just wish someone could convince my hoster of this. Their answer on the subject:
mod_gzip is not a possibility on the server, as the associated loads (and temporary file generation) are insufficient. If this was a dedicated server then it wouldnt be a problem, but high loads on a shared server can cause serious issues.
Humbug.
rvm_css has still helped a lot in terms of perceived site speed though. It rocks.
The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.
Txp Builders – finely-crafted code, design and Txp
Offline
Re: rvm_css (v1.2)
Ruud, how are you handling changes in the CSS file in the ‘css’ directory?
I am used to edit my static CSS file with a feature rich editor which is getting the file via FTP.
I assume that saving the file via FTP results in a conflict with the CSS stored in the database.
Is there a possibility to synchronize the files via date?
One problem might be a time offset between server and local desktop.
Get all online mentions of Textpattern via OPML subscription: TXP Info Sources: Textpattern RSS feeds as dynamic OPML
Offline