Skip to content
조회 수 4349 추천 수 0 댓글 0
?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄 첨부
?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄 첨부

Minify로 CSS, JS파일, gzip으로 한꺼번에 압축해서 전송하기

minify tmp folder location re.png


 
1. http://code.google.com/p/minify/ 에서 minify 최신버전을 다운받습니다.

2. 압축을 해제한 후, min/config.php 파일을 수정합니다.
//$min_cachePath = '/tmp'; 라는 부분을 찾아
앞에 주석처리 // 부분을 지우고 /tmp를 ./cache로 수정합니다.
$min_cachePath = './cache';

Update for you:

Example using WAMP server on windows:

example.com is at: d:/www/example.com

minify folder: d:/www/example.com/htdocs/static/utils/min (note: you can also have min under example.com/htdocs/min, it is just how I prefer it)

in min/config.php I have this:

$min_allowDebugFlag = false;
$min_errorLogger = false;
$min_enableBuilder = false;

$min_cachePath = 'd:/www/example.com/cache/minify';

$min_documentRoot = '';
$min_cacheFileLocking = true;
$min_serveOptions['bubbleCssImports'] = false;
$min_serveOptions['maxAge'] = 31556926;
$min_serveOptions['minApp']['groupsOnly'] = false;
$min_serveOptions['minApp']['maxFiles'] = 10;

So basically I set it relative to the site root, not to the server's own tmp directory.




3. FTP로 min폴더만 업로드합니다.
XE설치 폴더에 상관없이 무조건 루트에 업로드합니다.
ex) XE가 www/xe/에 설치되어 있어도 www/min/
      XE가 www/에 설치되어 있어도 www/min/

4. 업로드 한 뒤에 min/cache 폴더를 만들어 퍼미션을 707로 줍니다.

5. XE 설치 디렉토리에 있는 .htaccess 파일을 수정합니다.

6. 아래의 2가지 경우중 해당되는 구문을 .htaccess 파일의 맨 아랫줄에 추가합니다.
- XE 설치경로가 /xe/ 로 사용되는 경우
RewriteRule ^(.*\.(css|js))$ ../min/index.php?f=xe/$1 [L]

- XE 설치경로가 루트디렉토리인 경우
RewriteRule ^(.*\.(css|js))$ /min/index.php?f=$1 [L]

7. 완료되었습니다.
제대로 설치됐는지 확인하시려면 사이트에 다시 들어간 다음,
min/cache 폴더에 파일들이 생성되어 있으면 성공하였습니다.


#Minify #CSS #JS #gzip #urin79
TAG •
로그인 후 댓글쓰기가 가능합니다.

?

List of Articles
번호 분류 제목 날짜 조회 수
32 Server 오토셋과 apmsetup file 2016.02.17 2027
31 Server Windows APM Install(Apache 2.4, PHP 6.0, Mysql) 최신버전 설치해보기 2015.11.27 1248
30 Server 파일 업로드 폴더 변경 2015.07.13 1959
29 Server XE ckeditor 모바일에서 사용하기 2015.07.13 1157
28 Server XE 카카오톡 글전송 2015.07.08 1225
27 Server APMSETUP7 PHP 업그레이드 2015.06.02 6377
26 Server XE 업데이트 후 모듈업데이트가 안될때 참고 file 2015.03.13 1445
25 Server php.ini 파일설정으로 파일업로드 용량늘리기 2015.03.03 1158
24 Server 웹하드 서버 구축하기 2 file 2015.03.03 3282
23 Server XE DB 튜닝 2014.09.13 4378
22 Server php) 이미지 사이즈 구해서 0이면 게시물 내용 없애기 2013.07.05 11294
21 Server php) 엑셀로 저장하기 2013.05.24 22069
20 Server Apache & Mysql 셋팅방법(httpd-mpm.conf / my.ini) 2013.05.13 13718
19 Server PHP Proxy 가져오기 2 2013.04.20 14191
18 Server Google Chart API 이용하기 11 file 2013.04.10 20907
17 Server Proxy and hide ip address problem 1 1 2013.04.03 12010
16 Server 아파치 성능테스트 프로그램 1 file 2013.04.03 14065
15 Server 웹 페이지에 HTML5 동영상 컨트롤 추가 10 2013.04.02 9464
14 Server PHP) Example #1 HTML 엔티티 디코딩 13 2013.04.02 10188
13 Server php) curl_setopt의 옵션 1 10 2013.04.02 12947
Board Pagination Prev 1 2 3 4 5 Next
/ 5

http://urin79.com

우린친구블로그

sketchbook5, 스케치북5

sketchbook5, 스케치북5

나눔글꼴 설치 안내


이 PC에는 나눔글꼴이 설치되어 있지 않습니다.

이 사이트를 나눔글꼴로 보기 위해서는
나눔글꼴을 설치해야 합니다.

설치 취소