Generate Javascript file with PHP

前端 未结 1 636
死守一世寂寞
死守一世寂寞 2021-01-05 17:26

My current code

I have started writing an API that loads, minifies and returns javascript files into one file using PHP. This is achieved by pointing to a PHP file

相关标签:
1条回答
  • 2021-01-05 18:25

    Faster as .js yes, but marginally. The reason being that it would be a static file so wouldn't need the processing time PHP will take.

    That said there's nothing wrong with feeding JavaScript through PHP like this. You could even come up with caching methods as well to reduce the processing impact.

    0 讨论(0)
提交回复
热议问题