{"action":"created","issue":{"url":"https://api.github.com/repos/domoticz/domoticz/issues/552","repository_url":"https://api.github.com/repos/domoticz/domoticz","labels_url":"https://api.github.com/repos/domoticz/domoticz/issues/552/labels{/name}","comments_url":"https://api.github.com/repos/domoticz/domoticz/issues/552/comments","events_url":"https://api.github.com/repos/domoticz/domoticz/issues/552/events","html_url":"https://github.com/domoticz/domoticz/issues/552","id":139637828,"number":552,"title":"Compress static web content at buildtime","user":{"login":"gaudryc","id":14302044,"avatar_url":"https://avatars.githubusercontent.com/u/14302044?v=3","gravatar_id":"","url":"https://api.github.com/users/gaudryc","html_url":"https://github.com/gaudryc","followers_url":"https://api.github.com/users/gaudryc/followers","following_url":"https://api.github.com/users/gaudryc/following{/other_user}","gists_url":"https://api.github.com/users/gaudryc/gists{/gist_id}","starred_url":"https://api.github.com/users/gaudryc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gaudryc/subscriptions","organizations_url":"https://api.github.com/users/gaudryc/orgs","repos_url":"https://api.github.com/users/gaudryc/repos","events_url":"https://api.github.com/users/gaudryc/events{/privacy}","received_events_url":"https://api.github.com/users/gaudryc/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":7,"created_at":"2016-03-09T17:00:01Z","updated_at":"2016-03-10T13:18:37Z","closed_at":null,"body":"I will submit a change request allowing :\r\n- the web server to always deliver the gzipped version of a js or css file ;\r\n- git to manage the textual version of js or css file, so we could have access to the history and we could make diff on these files.\r\n\r\nIt consists of modifying the building process to always compress the files with extensions .js, .json and .css, in the www/ folder.\r\n\r\nThe compression process consists in :\r\n- compressing the file to .js.gz, .json.gz or .css.gz ;\r\n- change the timestamp of the .gz file with the timestamp of the uncompressed file.\r\n\r\nUnder OSX and Linux, the compression is done with \"gzip\" and the timestamp change is done with \"touch\".\r\nUnder Windows, the compression is done with \"7z.exe\" and the timestamp change is done with \"touch.exe\" (coming from http://stevemiller.net/apps/).\r\n\r\nWith all these changes, we can do the whole compression at buildtime :\r\n- by modifying the CMakeLists.txt for OSX and linux environment, or any build environment with CMake support.\r\n- by adding a PostBuildEvent in the Visual Studio solution.\r\nIn both cases :\r\n- the compression is done only when the uncompressed file is newer than its compressed version, or when the compressed version does not exist.\r\n- any new .css, .js or .json will be compressed before packaging.\r\n\r\nWhen building using cmake, the \"make clean\" command only removes compressed files that have been generated using cmake.\r\n\r\nWhat do you think about that ?"},"comment":{"url":"https://api.github.com/repos/domoticz/domoticz/issues/comments/194836478","html_url":"https://github.com/domoticz/domoticz/issues/552#issuecomment-194836478","issue_url":"https://api.github.com/repos/domoticz/domoticz/issues/552","id":194836478,"user":{"login":"gizmocuz","id":2265299,"avatar_url":"https://avatars.githubusercontent.com/u/2265299?v=3","gravatar_id":"","url":"https://api.github.com/users/gizmocuz","html_url":"https://github.com/gizmocuz","followers_url":"https://api.github.com/users/gizmocuz/followers","following_url":"https://api.github.com/users/gizmocuz/following{/other_user}","gists_url":"https://api.github.com/users/gizmocuz/gists{/gist_id}","starred_url":"https://api.github.com/users/gizmocuz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gizmocuz/subscriptions","organizations_url":"https://api.github.com/users/gizmocuz/orgs","repos_url":"https://api.github.com/users/gizmocuz/repos","events_url":"https://api.github.com/users/gizmocuz/events{/privacy}","received_events_url":"https://api.github.com/users/gizmocuz/received_events","type":"User","site_admin":false},"created_at":"2016-03-10T13:18:37Z","updated_at":"2016-03-10T13:18:37Z","body":"Yes, the compression is only needed in the user environment, not in the developer environment (sure not in development else we can not add changes to the web interface)\r\nCurrently the web server supports both, so when i need to work in domoticz.js i unpack the .gz file, and delete the .gz file, and when i am done, i create a new domoticz.js.gz file\r\n... pretty complex indeed...\r\nIt would be create if we can deliver compressed output, and it is generated in:\r\n- Windows->NSIS installer\r\n- travis-ci\r\n- CMake (make package)\r\n\r\n"}}