i'm not really a go dev. i watched some course and decided it was too low level for me. however i needed something simple and efficient and decided that go was the right tool for the job.
what the program does is open a webserver. if it recieves a request and the api key matches allows to upload or delete files, and if it's not authenticated and knows the exact name of a file, it allows to download.
looking for ways to optimize this i had an idea and whanted to ask if it was possible. since the only thing my server does with the uploaded file is store it and send it back gzipped: Would it be possible to detect if a client is already uploading gzipped and store it as-is (no server side decompression) and when the next request asks for that file, i don't have to compress it again (honestly, it seems like a waste for the client to compress, than server decompresses, then the server compresses it again and the client decomrpesses)
Top comments (1)
Not really a go dev myself but a quick look on google seems like to exsist an Ext() function that allows you to detect the file extension. From there you can decide wheter the file need compression or if it is already gzipped then you can store it as it is 😃