You reference them with the normal .js and .css extensions and check if gzip works by checking the response headers for CSS and JS files, checking them using firebug or the developer tools.
Gzipping is usually done at the web server level.
If you use tomcat, you can open the conf / server.xml of your Tomcat installation and add the following to the Connector definition.
<Connector port="8080" protocol="HTTP/1.1" redirectPort="8443" connectionTimeout="20000" compressableMimeType="text/html,text/xml,text/css,text/javascript,text/plain,application/javascript,application/json" compression="2048"/>
For Apache, find mod_gzip or mod_deflate
This applies to your root .htaccess file, but if you have access to httpd.conf it is better.
<ifModule mod_deflate.c> <filesMatch "\.(js|css)$"> SetOutputFilter DEFLATE </filesMatch> </ifModule>
source share