aspose file tools*
The moose likes HTML, CSS and JavaScript and the fly likes Is the call to include javascrip in HTML document cached? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Is the call to include javascrip in HTML document cached?" Watch "Is the call to include javascrip in HTML document cached?" New topic
Author

Is the call to include javascrip in HTML document cached?

Susan Smith
Ranch Hand

Joined: Oct 13, 2007
Posts: 224
Hello,

I apologize in advance if this is a newbie question.

I'm including json data in .js file in my web application.
I put this in the head element of the html page:


My question: Is the above somehow cached in the browser? Or does it load every time the page is load?
Based on my observation, it looks like it doesn't get cached since it takes long time to load every time.
I'm trying to see if there's a way I can make it cached since the JSON data is pretty big and takes some time to load.

Thank you for the advice.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61429
    
  67

"JavaScript" not "javascrip"

Usually, yes, .js files will be cached. But there a lot of variables that can affect that including the browser settings, and the response headers sent by the server.

You can determine this for yourself with a tool that shows the HTTP request being sent and received (HttpFox is one I know of off the top of my head).


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Is the call to include javascrip in HTML document cached?