Skip to content

Commit

Permalink
gzip compression is working
Browse files Browse the repository at this point in the history
  • Loading branch information
brianhanifin committed Jun 20, 2014
1 parent a05b1c8 commit 8cb346a
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 5 deletions.
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,4 @@ node_modules/

.idea/
*.iml
database_configuration.json
/database_configuration.json
my.env
Binary file modified audio/alarm.mp3.gz
Binary file not shown.
Binary file modified audio/alarm2.mp3.gz
Binary file not shown.
5 changes: 2 additions & 3 deletions server.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,8 @@ var cgmData = [];
var PORT = process.env.PORT || 1337;
var server = require('http').createServer(function serverCreator(request, response) {
var nodeStatic = require('node-static');
//serve .mp3s as .mp3.gz files + cache for 1 year
//var staticServer = new nodeStatic.Server(".", { cache:29030400, gzip:/^\/mp3/, headers: {'Content-Encoding':'gzip'} });
var staticServer = new nodeStatic.Server(".", { cache:29030400, gzip:'true', headers: {'Content-Encoding':'gzip'} });
//enable gzip compression and cache for 30 days
var staticServer = new nodeStatic.Server(".", { cache:2592000, gzip:true });
var sys = require("sys");

// Grab the URL requested by the client and parse any query options
Expand Down

0 comments on commit 8cb346a

Please sign in to comment.