T
T
theRavel2011-11-03 00:47:02
PHP
theRavel, 2011-11-03 00:47:02

JS & CSS compression using PHP?

Hello everyone,
I need to write a script to compress (not obfuscate) JS and CSS files in my project. Part of the script is already ready, so we consider that given:
one regular JS file and one regular CSS file,
You need to get:
one compressed JS file and one compressed CSS file.
Files will need to be compressed before deploying the application, so the library should not be able to cache anything, and even performance is not fundamentally important.
When I start googling, my eyes widen. Therefore, I would very much like to listen to the advice of living people about the ease of use, the advantages and disadvantages of different solutions.
Sorry if this question has already been asked, I couldn't find it.
Thanks in advance for your help
Dmitry

Answer the question

In order to leave comments, you need to log in

5 answer(s)
M
Mikhail Osher, 2011-11-03
@theRavel

code.google.com/p/minify/developer.yahoo.com/yui/compressor/ Used
minify
, really liked it.

M
mark_ablov, 2011-11-03
@mark_ablov

GCC (Google Closure Compiler, not what everyone thought :) ).
Written in Java.
Why do you need PHP - xs.

L
Lico, 2011-11-03
@Lico

ob_start("ob_gzhandler");
echo file_get_contents('/path/to/file');

R
Roman, 2011-11-03
@lampa

habrahabr.ru/blogs/ajax/10500/

L
Leonid Smirnov, 2018-09-08
@SunyJun

https://www.pandoge.com/moduli_i_skripty/minifikac...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question