How to create gzip compression

Started on the old forum in August 2012 · view the original in the archive · old links redirect here

5 replies · 564 views · started 14 years ago · 1 min read

4 participants
Rrobyf Newbie · 9 posts #1

master, please share tutorial create gzip compression for wapsite

mFreak Developer · 66 posts #2

Rrobyf wrote: master, please share tutorial create gzip compression for wapsite

what do you want to do? Make gzip archives or gzip output compression?

Added after 3 minutes:

for output compression check zlib.output.compression or ob_gzhandler at php.net PHP: Runtime Configuration - Manual

Added after 2 minutes:

and again for creating files you can use zlib library, PHP: Zlib - Manual ,

$("#mfreak").find(".head brain").clone();

Progress:

[|||___________________________] : 5%

Output:

Memory limit reached, unable to complete operation.

Support answer:

Try using a super uber strong mega computer to reach at least 10%.

👋

GumSlone Administrator Principal · 1,690 posts #3

add this on the top of your pages:

if(strstr($_SERVER["HTTP_ACCEPT_ENCODING"],"gzip"))
	{
		header("Content-Encoding: gzip");
		header("Vary: Accept-Encoding");
		ob_start('ob_gzhandler');
	}

Advertise your mobile site for FREE with AdTwirl

External image (may be gone)

mFreak Developer · 66 posts #4

GumSlone wrote: add this on the top of your pages:

if(strstr($_SERVER["HTTP_ACCEPT_ENCODING"],"gzip"))
	{
		header("Content-Encoding: gzip");
		header("Vary: Accept-Encoding");
		ob_start('ob_gzhandler');
	}

and he should add

ob_end_flush();

at the end of the script. But zlib ob is encouraged if its avaible, as I read somewhere.

$("#mfreak").find(".head brain").clone();

Progress:

[|||___________________________] : 5%

Output:

Memory limit reached, unable to complete operation.

Support answer:

Try using a super uber strong mega computer to reach at least 10%.

👋

softwarefreak Senior · 349 posts #5

mFreak wrote: and he should add

ob_end_flush();

at the end of the script. But zlib ob is encouraged if its avaible, as I read somewhere.

No need to add ob_end_flush() 😛 output is flushed by default 😛 until u don't use end clean 😀

I need some facebook likes, can you please help me 🤝 http://facebook.com/softwarefreakin I noticed social media is really powerful 🧙 Well DONE is better than well SAID

mFreak Developer · 66 posts #6

softwarefreak wrote: No need to add ob_end_flush() 😛 output is flushed by default 😛 until u don't use end clean :D

what if he need to output before the script ends 😛. Just trying to be smart 😉, thanks for info.

$("#mfreak").find(".head brain").clone();

Progress:

[|||___________________________] : 5%

Output:

Memory limit reached, unable to complete operation.

Support answer:

Try using a super uber strong mega computer to reach at least 10%.

👋

Sign in to reply.

Similar topics

Keyboard shortcuts

g f
Go to forums
g h
Go to your feed
g m
Go to messages
r
Reply (in a topic)
/
Search
j
Next post
k
Previous post
?
This list
Ctrl/⌘ + Enter
Send what you are writing
Ctrl/⌘ + B / I
Bold / italic while writing
Esc
Close