Best practice for saving mini files and deployment / development

I was stuck in a dilemma on how to get around this, and was hoping someone would point me in the right direction.

I am trying to reduce the size of css and javascript files to improve the performance of our site. But the problem is that during deployment we just upload our latest version of svn repository to the server.

It’s hard for me to add this extra step for each developer to minimize the files before each change, as this adds the risk of negligence and human error.

In any case, I thought that the server has a readable version of the files, but with some kind of file monitor that will execute the minifier when the file changes and will update the file used by the site. Has anyone implemented this before?

EDIT

We are currently working on ASP.Net 2.0, Windows Server 2003

+6
source share
2 answers

If you use .net on the server, you can also try RequestReduce , available on Nuget. It blows and binds your css and js, as well as sprites of css background images. It does this on the fly, so your developers don't need to do this as an extra step. As long as you have some version execution that changes the css / js url when it changes, RequestReduce will automatically detect the change and process the file. It does all this in the background and therefore does not affect the response time. If the files are not versioned by URL, RequestProduce provides a dashboard where you can clear your cache. RequestReduce can be deployed without any code changes and almost no configuration in most use cases.

+2
source

If you use ASP.NET, try the MBCompression library - it automatically reduces files and you do not need to do this manually:

+1
source

Source: https://habr.com/ru/post/905217/


All Articles