Why aren't PHP files used for (custom) CSS and JS?

后端 未结 8 1148
旧时难觅i
旧时难觅i 2020-12-15 22:27

Why don\'t people make .php files for their CSS and JavaScript files?

8条回答
  •  一生所求
    2020-12-15 23:04

    Running the PHP engine does not have a zero cost, in either time or CPU. And since CSS and JavaScript files usually rarely change, having them run through the engine to do absolutely nothing is pointless; better to let the browser cache them when appropriate instead.

提交回复
热议问题