After 2 days of work, we got success with the minification and combine multiple js files in one file.
In our framework, first we create the minified file, if not exist. and from PHP/template file we are loading same file in <script src=''></script>
tag.
But each time when we are requesting for the same js file, each time it gets downloaded by the browser (As it shows 200 Ok status) but we are expecting to be 304 (Not modified) as that file was requested before as well.
What we can do so that the file will be get cached by browser?
Edit 1 :
<?php
$content = NULL;
$jsFiles = array(..);//all files
foreach($jsFiles as $file) {
$content .= file_get_contents($file);
}
$minifiedContents = jsMinify($content);
file_put_contents($MinifiedJsFilePath, $minifiedContents);//minified.js
?>
<html>
<head>
<title>Minification</title>
<script src="minified.js"></script>
</head>
</html>