사이트 내 전체검색

 

웹사이트 압축률 체크

페이지 정보

로빈아빠 조회 226회 2018-02-13 14:39

본문

Compress Your Content
Compressing your content saves bandwidth and improves render time, particular on devices with slow internet connections. But it also reduces load on your server. While it does take some amount of computer power to compress files on the fly, you save much more power by having your server doing fewer things at once. It takes a lot less time to transfer files that are smaller. Your server is therefor, at any given time, maintaining far fewer open connections. There really is no down-side to enabling some form of HTTP compression.

The best way to enable this compression, is by using mod_deflate or mod_gzip. You can use them to automatically compress all HTML, CSS, JavaScript and XML content. And even SVG images, which are a form of xml. If your server is not configured to compress content, and you are unable to change that, there is an alternative. It only applies to HTML, but you can add one simple line of PHP to the top of your documents, to let PHP gzip the HTML on the fly.

Simply add this line to the top of your PHP documents:
<? ob_start("ob_gzhandler"); ?>
It has to be inserted before any content is outputted. It's not as efficient as mod_deflate, but it still works well and saves a ton of bandwidth and processor power.
추천0

댓글목록

등록된 댓글이 없습니다.

게시물 검색

 

회원로그인

접속자집계

오늘
71
어제
562
최대
3,566
전체
2,422,803