Reputation: 3987
I have a php file, content.php, which includes a another php file, viedo.php. Inside video.php i use a script tag to do some javascript stuff for displaying a video. I was wondering if i were to put the script into an external javascript file, would that file be cachable, and if so, is this bad/good practice? My thinking is, since php builds the page when you navigate to the url, im not sure if the browser will be able to tell if the javscipt file was cached.
content.php
<?php
include 'nav.php';
// ...
include 'video.php';
// ...
php include 'footer.php';
?>
video.php
<div>
<div id="myDiv">This text will be replaced with a player.</div>
<script>
jwplayer("myDiv").setup({
"file": "http://example.com/myVideo.mp4",
"image": "http://example.com/myImage.png",
"height": 360,
"width": 640
});
</script>
</div>
Upvotes: 0
Views: 69