Archived

This topic is now archived and is closed to further replies.

  • 0

How to compress the pagelines compiled css

Question

Posted · Report post

We are using WP Total Cache Plugin already with Enabled HTTP (gzip) compression for CSS & Js But still the test at Google Page Speed Insights shows the below error. Compressing the following resources with gzip could reduce their transfer size by 85.4KiB (82% reduction). Compressing http://learn.studyworldglobal.com/wp-content/themes/pagelines/pagelines-compiled-css-1343368114/ could save 85.4KiB (82% reduction). How to compress the pagelines compiled css.

Share this post


Link to post
Share on other sites

16 answers to this question

Posted · Report post

True. The server also runs the PHP code and hands out the HTML files. The server does compress .css files. However, PageLines does not create a .css file. Is there a way that PageLines can be told to create a .css file, and not pagelines-compiled-css_<random number string thing>? Maybe PageLines could just create a file like "pagelines-compiles-css.<randomnumber>.css and then a server, etc., would know what type of file it is? Unless you have an idea what the regex expression should be for the file so it can be identified as a css file to compress? Anything?

Share this post


Link to post
Share on other sites

Posted · Report post

Hi KarenB,

Can you provide a link to your website please. Also, if you're on shared hosting, this type of hosting isn't designed for performance, with web hosting you most definitely get what you pay for and if your hosting is $1 per year, then it doesn't really matter how much caching you do, it will always be slow. But providing us with a link will help us.

Share this post


Link to post
Share on other sites

Posted · Report post

Hi, You have a minify option for the Compiled CSS file. Which is located in Wordpress Admin Dashboard > Site Options > Advanced > Minification.

Share this post


Link to post
Share on other sites

Posted · Report post

- and the server is Apache, and it would / could use the deflate option, and for most who are using the W3, it already sets a directive to compress .css files. Point being, all other .css files are being compressed.

 

wp-content/themes/pagelines/pagelines-compiled-css-1_1361124053 = Not compressed

wp-content/plugins/photonic/include/scripts/fancybox/jquery.fancybox-1.3.4.css.gzip = compressed (note that it is recognized as a .css file)

 

 

 

<IfModule mod_deflate.c>
    <IfModule mod_headers.c>
        Header append Vary User-Agent env=!dont-vary
    </IfModule>
        AddOutputFilterByType DEFLATE text/css text/x-component application/x-javascript application/javascript text/javascript text/x-js text/html text/richtext image/svg+xml text/plain text/xsd text/xsl text/xml image/x-icon application/json
    <IfModule mod_mime.c>
        # DEFLATE by extension
        AddOutputFilter DEFLATE js css htm html xml
    </IfModule>
</IfModule>

Share this post


Link to post
Share on other sites

Posted · Report post

It does create a CSS file. If you bothered to read the whole topic you will see the code to turn the file mode on. Fact is its an old topic and that code isn't even needed now as its turned on by default. If yours still isn't creating a file then there is something stopping it. Could be file permissions missing php extensions or a number of other things, this is why we ask people to open a new topic so we can support you and not bother the original poster with email alerts every time his old topic is bumped with unrelated questions. Sent from my iPad using Tapatalk HD

Share this post


Link to post
Share on other sites

Posted · Report post

That's already done. The above issue is faced after all those changes.

Share this post


Link to post
Share on other sites

Posted · Report post

Hi Rockstar,

www.pdmwa.net.au

Yes, I am on shared hosting which accounts for up to 6s of latency. This is bad but I'm stuck with it. the uncompressed compiled css and the others should be though..

thanks

Share this post


Link to post
Share on other sites

Posted · Report post

Firstly, as its already been suggested in this topic, enable the file mode.

Secondly compression is at server level, depending on your host and the server type you may be able to add something to .htaccess, ask your host if they support DEFLATE.

Share this post


Link to post
Share on other sites

Posted · Report post

The css is already minified: http://learn.studyworldglobal.com/wp-content/themes/pagelines/pagelines-compiled-css-1343638055/ To gzip you will have to turn the file mode on by adding the following to wp-config.php

define( 'LESS_FILE_MODE', true );

Over optimisation will actually slow your site down, especially as you have opted to use disk based object/database and page caching, most cheap shared hosts used network filesystems and are slow as custard.

Share this post


Link to post
Share on other sites

Posted · Report post

Hi Karma and Simon,

Still unable to compress compiled css and js.

Server says that deflate is supported and confirmed with their own ping test, results are copied below.

I was mistaken in saying that "some some files are compressed whilst these are not. Webpage test reports:

GZIP encode all appropriate text assets: 50/100"

None are compressed, I misunderstood the 50% part.

So -

Host says deflate is enabled and turned on

I had already added define('LESS_FILE_MODE',true); to the wp-config,php file

What can I do? Help.

From my server:

"According to our tech Ryan, we do support deflate on the server and it looks like you've turned it on (see below)

"Accept-Encoding: gzip,deflate' http://www.pdmwa.net.au/

"HTTP/1.1 200 OK

"Date: Thu, 11 Oct 2012 05:29:57 GMT

"Server: Apache/2.2.11 (Unix) PHP/5.2.17 FrontPage/5.0.2.2635

"Vary: Accept-Encoding,Cookie

"Last-Modified: Wed, 10 Oct 2012 05:31:34 GMT

"Accept-Ranges: bytes

"Content-Length: 3206

"Cache-Control: max-age=96, public, must-revalidate, proxy-revalidate

"Expires: Thu, 11 Oct 2012 05:31:34 GMT

"X-Pingback: http://www.pdmwa.net.au/xmlrpc.php

"X-Powered-By: W3 Total Cache/0.9.2.4

"Pragma: public

"Content-Type: text/html; charset=UTF-8

"Content-Encoding: gzip "

Share this post


Link to post
Share on other sites

Posted · Report post

Hi Karma,

I had already added

define('LESS_FILE_MODE',true); to the wp-config,php file

I will check on the server and DEFLATE.

However, some files are compressed whilst these are not. Webpage test reports::

GZIP encode all appropriate text assets: 50/100

289.0 KB total in compressible text, target size = 146.4 KB - potential savings = 142.6 KB

FAILED - (103.9 KB, compressed = 18.8 KB - savings of 85.1 KB) - http://www.pdmwa.net.au/wp-content/themes/pagelines/pagelines-compiled-css-1348742586/

FAILED - (49.9 KB, compressed = 13.5 KB - savings of 36.3 KB) - http://www.pdmwa.net.au/wp-content/themes/pagelines/sections/features/script.cycle.js?ver=2.9994

FAILED - (22.3 KB, compressed = 6.3 KB - savings of 16.0 KB) - http://www.pdmwa.net.au/wp-content/themes/pagelines/js/script.bootstrap.min.js?ver=2.0.3

FAILED - (5.9 KB, compressed = 2.4 KB - savings of 3.6 KB) - http://www.pdmwa.net.au/wp-content/plugins/thethe-tabs-and-accordions/style/js/thethe.haccordion.js?ver=3.4.2

FAILED - (2.7 KB, compressed = 1.2 KB - savings of 1.5 KB) - http://www.pdmwa.net.au/wp-content/plugins/thethe-tabs-and-accordions/style/js/thethe.toggle.js?ver=3.4.2

Thanks, Karen

Share this post


Link to post
Share on other sites

Posted · Report post

karenb As i mentioned before, script compression is done on the server. It depends on whether the host has it enabled and the type of server software. Contact your host and ask how to compress css/js with DEFLATE.

Share this post


Link to post
Share on other sites

Posted · Report post

http://www.whatsmyip.org/http-compression-test/ Go to this web page, insert any css/js link from your site for example this one http://www.pdmwa.net.au/wp-content/themes/pagelines/js/script.blocks.js?ver=1.0.1

The result is no compression enabled for js and css files. As I already said before this is a server level setting. Usually yu have to add something to .htaccess but your host will b abl to tell you.

Share this post


Link to post
Share on other sites

Posted · Report post

How do you tell the server to compress the PageLines CSS?

Share this post


Link to post
Share on other sites

Posted · Report post

How do you tell the server to compress the PageLines CSS?

Compression is done at a server level, depends on the server software you would need to ask you host.

Share this post


Link to post
Share on other sites

Posted · Report post

Please Help. Trying to increase site speed.

Please help me to gzip

. compiled css at 108kB

, /features/script.cycle.js?ver2.9994 at 50kB and ,

./script.bootstrap.mini.js?ver2.0.3 at 22 kB

www.pdmwa.net.au

I have:

. installed w3tc and I think it's working

. added define( 'LESS_FILE_MODE', true ); to the wp-config,php file

. deactiveated 'use google libraries'

. smushed everything....

i'm on a shared server and will swallow the latency there.

Share this post


Link to post
Share on other sites