Jump to content

Gzip compression


derece

Recommended Posts

Posted

I'd recommend posting in the peer to peer forums. ;) This is a feedback/feature suggestion forum here. :)



http://community.invisionpower.com/topic/310012-php-extensions-that-minify-uses-to-gzip-the-content/
Posted

It's possible you don't have the PHP extensions that minify uses to gzip the content installed.



Or Apache2 doesnt use that mod anymore.
http://www.webhostingtalk.com/showpost.php?p=6791944&postcount=2
So it doesnt matter do i enable or not this in ACP...
Posted

Or Apache2 doesnt use that mod anymore.



So it doesnt matter do i enable or not this in ACP...



Just posted in your other thread, it's nothing to do with Apache ;)
Posted

I'll share this tid-bit of code I use in my non-IPB application to gzip/deflate:


$content = 'your html code';

$gzip_on = true;

if($gzip_on and ! headers_sent() and ! empty($_SERVER['HTTP_ACCEPT_ENCODING']))

{

	$encode_map = array(

		'gzip' => 'gzencode',

		'x-gzip' => 'gzencode',

		'deflate' => 'gzcompress'

	);


	$content_length = strlen($content);


	foreach($encode_map as $method => $func)

	{

		if(function_exists($func) and strpos($_SERVER['HTTP_ACCEPT_ENCODING'], $method) !== false)

		{

			$enc_content = $func($content, 9);


			if(strlen($enc_content) < $content_length)

			{

				header('Content-Encoding: '.$method);

				$content = $enc_content;

			}


			break;

		}

	}

}


print $content;




It works on any web server, and provides encoding for what ever the browser supports :).

Posted

It causes the javascript and CSS files to be gzipped (if you use minify).



Minify is a standalone third party script - we can't control it from the ACP. Although, I believe we could ship with gzip enabled possibly (or maybe we did initially, and some had trouble with it, I can't recall now).




change both to 1 and does not work either

from google pagespeed


Compressing the following resources with gzip could reduce their transfer size by 83.5KiB (74% reduction).





[url="http://www.hellouk.org/forum/public/min/index.php?f=public/style_css/css_7/calendar_select.css,public/style_css/css_7/ipb_editor.css,public/style_css/css_7/ipb_styles.css,public/style_css/css_7/ipshoutbox.css"]forum/public/min/index.php?f=public/style_css/css_7/calendar_select.css,publi...[/url] could save 36.4KiB (77% reduction).



Posted

change both to 1 and does not work either



from google pagespeed



You do understand those Google statistics are no where near live ? I've seen them take 3-4 weeks to update before.
  • 3 weeks later...
Posted

Open up public/min/config.php



Look for



$min_serveOptions['encodeOutput'] =0;



make that



$min_serveOptions['encodeOutput'] =1;



Edit groupsConfig.php also.



Still valid in 3.1?
  • 1 year later...
Posted

Open up public/min/config.php



Look for



$min_serveOptions['encodeOutput'] =0;



make that



$min_serveOptions['encodeOutput'] =1;



Edit groupsConfig.php also.




Will this work for IPB 3.2.3?
Posted

Yes, that'll still work.



Still no change according to Chrome's Page Speed analyzer tool.

I made the change in the config.php file. The groups.Config.php file already had the change so I didn't mess with that.

After I made the one change in the config.php file, I cleared my browsing cache, hard-reloaded the page and ran the page spped tool and nothing changed.

Was there anything else i needed to do?

post-192203-0-27999000-1324027250_thumb.
Posted

In my limited experience testing Chrome's tool, it caches the results heavily, so when you make changes they won't show up right away. You have to clear your browser cache and restart Chrome.

The yslow tool in Firefox is a lot more reliable for testing real-time changes (i.e., use yslow in firebug in Firefox, and then once you are happy the changes show, launch Chrome and use the pagespeed tool there to confirm Chrome sees them too).

Posted

In my limited experience testing Chrome's tool, it caches the results heavily, so when you make changes they won't show up right away. You have to clear your browser cache and restart Chrome.



Isn't that what I said I did above? I did it all, man. Cleared the cache and restarted the Browser; no changes. So, what gives?

The yslow tool in Firefox is a lot more reliable for testing real-time changes (i.e., use yslow in firebug in Firefox, and then once you are happy the changes show, launch Chrome and use the pagespeed tool there to confirm Chrome sees them too).



They're both great tools, however, they both yield similar results. Why won't these files cache?

post-192203-0-04700900-1324059528_thumb.
Posted

Isn't that what I said I did above? I did it all, man. Cleared the cache and restarted the Browser; no changes. So, what gives?





They're both great tools, however, they both yield similar results. Why won't these files cache?



post-192203-0-04700900-1324059528_thumb.

Those files are not loaded thru Minify.
Posted

I'm lost then. The creator of this topic had some similar files listed. Matt made a suggestion for those files. Was that suggestion applicable or not? If not, what shall be done to ensure these files are compressed somehow?

Posted

All of the files you have listed in your output are custom files you uploaded and are presumably including somewhere (skin customization, IP.Content custom block, etc.).

The changes in minify will allow minify to send the proper caching headers. If the files you are seeing are not sending the proper cache headers, that means your *server* is not configured to do so. Just google ".htaccess cache headers" or something similar - there are dozens of tutorials that describe how to configure your server to specify that javascript, css and image files should cache.

Ultimately, however, this topic is veering a bit off course. It's turning into a support topic more-so than a feedback topic.

Archived

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

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...