CodeIgniter Forums
Loading views vs loading JS files - Printable Version

+- CodeIgniter Forums (
+-- Forum: Archived Discussions (
+--- Forum: Archived Development & Programming (
+--- Thread: Loading views vs loading JS files (/thread-60229.html)

Loading views vs loading JS files - El Forum - 02-09-2014

Is one superior to the other and if so which? My co-worker says that we need to load JS files rather than views with JS inside them due to browser caching. But when I look at the runtime for loading a view, it looks negligible. I see lots of advantages to loading views and the only rebuttal my coworker could make was browser caching. What's the right answer here?

E.G. which is superior or are they the same?

<script type="text/javascript" src="/path/to/file.js"></script>



The view version is a php file not a js file. Thanks!!