Chủ Nhật, 10 tháng 1, 2010

gzipping jQuery without mod_deflate

http://groups.google.com/group/jquery-en/browse_thread/thread/3d54b9c96f97d324/69b3972335566b69?pli=1

Unfortunately, i don't have admin rights on my server so i cannot
activate mod_gzip/mod_deflate to gzip the stuff on the fly. But here's
an easy workaround...

Create a PHP file called jquery.php:

< ?php ob_start( 'ob_gzhandler' ); echo join('',file('jquery-1.1.3.1.pack.js')); ob_end_flush(); ?>


Now, in the main site layout template i have:

<"scripts type='text/javascript' src='/include/js/jquery.php'>

Không có nhận xét nào:

Đăng nhận xét