Some like you Some like you - 5 months ago 19
PHP Question

(with )Wrapped css,js cache is not working with even same url

How Wrapper class works

I created php class and now I am able to do this to put together all my css,js .It works like this

then I wrote
and it begin to generate url like this[]=file.css&path[]=file2.css&path[]=file3.css

then in the server side I get all paths with in the array then I tried
for each of them,after that I wrote echo all results.It put together all
,if I wrote
it will be


Problem is browser is not cache this url.


I consider all security issues,I created token to send wrap_content.php to prevent file get content to work for any file that user request


I solved this problem,hope it will help someone who has same problem to solve this problem in the future I added these ones to wrap_contents.php:

$cache_expire_date = gmdate("D, d M Y H:i:s", time() + $cache_length);
    header("Expires: $cache_expire_date");
 header("Pragma: cache");
header("Cache-Control: max-age=2592000");

(if css) header("Content-type: text/css");

(if js) header('Content-Type: application/javascript');

This created css,js simulator on the response with php file.