Skip to content

[caching tip] js, css 캐싱 팁

Tip 조회 수 5335 추천 수 0 2013.01.23 15:02:12

아래와 같이 스크립트로 삽입을 하면 f5, ctrl+shift+r 등에 영향을 받지 않고 계속 캐싱되어 있게 됩니다.

load.js 파일로 하나 만들어둡니다.

아래의 스크립트들은 jQuery 1.9 대응하도록 수정을 좀 한것들인데 오류가 있을 수 있습니다.


// https://developers.google.com/speed/libraries/devguide
document.write('<script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.9.0/jquery.min.js">\x3C/script>');
document.write('<script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jqueryui/1.9.2/jquery-ui.min.js">\x3C/script>');
document.write('<script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jqueryui/1.9.2/i18n/jquery-ui-i18n.min.js">\x3C/script>');
document.write('<link rel="stylesheet" type="text/css" href="//ajax.googleapis.com/ajax/libs/jqueryui/1.9.2/themes/smoothness/jquery-ui.css" />');
document.write('<script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/swfobject/2.2/swfobject.js">\x3C/script>');

// https://css-browser-selector.googlecode.com/
document.write('<script type="text/javascript" src="//css-browser-selector.googlecode.com/git/css_browser_selector.min.js">\x3C/script>');
// https://jqueryplaceholder.googlecode.com/
document.write('<script type="text/javascript" src="//jqueryplaceholder.googlecode.com/git/jquery.placeholder-0.2.min.js">\x3C/script>');

// http://code.google.com/p/jcaret/downloads/list
document.write('<script type="text/javascript" src="//jquery-xeno-ui.googlecode.com/git/jquery/jquery.caret.min.js">\x3C/script>');

// http://archive.plugins.jquery.com/project/timers
document.write('<script type="text/javascript" src="//jquery-xeno-ui.googlecode.com/git/jquery/jquery.timers.min.js">\x3C/script>');

// https://github.com/brandonaaron/jquery-mousewheel/downloads
document.write('<script type="text/javascript" src="//jquery-xeno-ui.googlecode.com/git/jquery/jquery.mousewheel.min.js">\x3C/script>');

// http://www.dillerdesign.com/experiment/DD_belatedPNG/
if(window.CSSBS_ie6) {
    document.write('<script type="text/javascript" src="//jquery-xeno-ui.googlecode.com/git/DD_belatedPNG_0.0.8a.min.js">\x3C/script>');
    DD_belatedPNG.fix('.iepng');
}

// http://leandrovieira.com/projects/jquery/lightbox/
document.write('<script type="text/javascript" src="//jquery-xeno-ui.googlecode.com/git/lightbox/jquery.lightbox-0.5.min.js">\x3C/script>');
document.write('<link rel="stylesheet" type="text/css" href="//jquery-xeno-ui.googlecode.com/git/lightbox/jquery.lightbox-0.5.min.css" />');

// http://www.ama3.com/anytime/
document.write('<script type="text/javascript" src="//jquery-xeno-ui.googlecode.com/git/anytime/anytime.min.js">\x3C/script>');
document.write('<script type="text/javascript" src="//jquery-xeno-ui.googlecode.com/git/anytime/anytimetz.min.js">\x3C/script>');
document.write('<link rel="stylesheet" type="text/css" href="//jquery-xeno-ui.googlecode.com/git/anytime/anytime.min.css" />'); 


팁의 라이센스 : Public Domain

profile

I see no changes, wake up in the morning and I ask myself

Is life worth living should I blast myself

Things would never be the same.

태그
엮인글 :
http://adminplay.com/166916/304/trackback
List of Articles
번호 제목 글쓴이 날짜sort 조회 수
47 Tip 그누보드의 visit 문제 file ADMINPLAY 2012-01-16 6789
46 [긴급]그누보드 4.34.05 패치 ADMINPLAY 2012-01-16 5358
45 Tip 그누보드 팁. $wr_id 값을 사용하지 않습니다_라고 뜰때 해결방법 1 (그누보드 관련 게시판이 있다면....) ADMINPLAY 2012-01-16 11362
44 Tip 그누보드 팁. $wr_id 값을 사용하지 않습니다_라고 뜰때 해결방법 2 (그누보드 관련 게시판이 있다면....) ADMINPLAY 2012-01-16 5838
43 Tip 그누보드 팁. $wr_id 값을 사용하지 않습니다_라고 뜰때 해결방법 3 (그누보드 관련 게시판이 있다면....) ADMINPLAY 2012-01-16 6584
42 Tip 그누보드 메타태그(description, keywords) 설정 file [1] ADMINPLAY 2012-01-16 15397
41 Tip 중규모 커뮤니티 속도저하방지를 위한 튜닝 [그누보드 관련] ADMINPLAY 2012-01-16 8789
40 플러그인 그누보드 내글 모니터 (쿠키 및 구글 스타일 변환) file ADMINPLAY 2012-01-16 13178
39 플러그인 게시판의 정렬을 이용한 최신글 file ADMINPLAY 2012-01-16 28515
38 플러그인 게시물 순위를 이전과 비교해서 등수 출력 file ADMINPLAY 2012-01-16 11496
37 플러그인 코멘트 Ajax 처리 - 아직도 코멘트(댓글)쓰고 전체 페이지 로딩되나요? ADMINPLAY 2012-01-16 16636
36 Tip 효율적으로 디비 쿼리수 줄이기 Tip ADMINPLAY 2012-01-16 8013
35 플러그인 네이버 스타일 아웃로그인 스킨(?) file ADMINPLAY 2012-01-16 11837
34 Tip 투표(설문) 새창 띄우기 ADMINPLAY 2012-01-16 8826
33 Tip 포인트 반복 차감 기간 제한 ADMINPLAY 2012-01-16 8047
32 Tip 공지사항 리스트에 이중 출력 안되도록. ADMINPLAY 2012-01-16 10403
31 Tip 오늘의 주인공 onfocus="this.blur();"와 a:visited를 소개합니다. ADMINPLAY 2012-01-16 9991
30 Tip 그누보드 회원 포인트 일괄삭제 하기 (mb_point + 포인트 내역) ADMINPLAY 2012-01-16 9585
29 최적화 그누보드에서 효율적으로 디비에 쿼리수 줄이기 ADMINPLAY 2012-01-16 9004
28 Tip 출석시 과거 특정날짜 자동출석 인정하는 방법 - 미션출석부 l2zeo 2012-03-12 9322

Copyright ADMINPLAY corp. All rights reserved.

abcXYZ, 세종대왕,1234

abcXYZ, 세종대왕,1234