Solved

Simple LMS having loading errors only on live server (clear browser cache resolves)

Posted on 2013-11-26
8
563 Views
Last Modified: 2013-11-26
I've integrated VSSCORM (http://www.vsscorm.net/) into my CMS - it's basic but it works perfectly on my local test server (MAMP). I should also mention the SCORM packages are all tested on scormcloud to confirm they are correct first. The problem occurs on the Linux/Apache server (shared hosting).

When I test it on the live site server - a course will load for the first visit (or first few times) but then will show a blank screen and a javascript error:

  TypeError: SCORM_objAPI.LMSInitialize is not a function
  strResult = SCORM_objAPI.LMSInitialize("");

If this happens, a browser cache clear and reload, it will work again every time.

My first thought was I could simply try to stop the browser caching:

Added to the <head>...
<meta http-equiv="cache-control" content="max-age=0" />
<meta http-equiv="cache-control" content="no-cache" />
<meta http-equiv="expires" content="0" />
<meta http-equiv="expires" content="Tue, 01 Jan 1980 1:00:00 GMT" />
<meta http-equiv="pragma" content="no-cache" />

Then also tried adding to htaccess...
<FilesMatch "\.(swf)$">
FileETag None
<ifModule mod_headers.c>
Header unset ETag
Header set Cache-Control "max-age=0, no-cache, no-store, must-revalidate"
Header set Pragma "no-cache"
Header set Expires "Wed, 11 Jan 1984 05:00:00 GMT"
</ifModule>
</FilesMatch>

None of which makes any difference - the problem remains and the cache clear still does the trick.

Any ideas?
Many thanks
0
Comment
Question by:freshwaterwest
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 3
8 Comments
 
LVL 83

Expert Comment

by:Dave Baldwin
ID: 39676906
The 'meta' tags only affect the HTML part of the page, not the javascript files which will be cached separately.  And 'swf' is Adobe Flash so I'm not sure why you have that there.
0
 

Author Comment

by:freshwaterwest
ID: 39676944
Hi Dave, thanks for your reply,

I'd expected that the problem might be the swf file being cached so it was an attempt to prevent that, but I hadn't considered javascript caching.

Why might javascript be caching differently on the live server and what could I do to test it/prevent the caching?

thanks
Phil
0
 

Author Comment

by:freshwaterwest
ID: 39677007
I think I may have sorted this, simply by adding a random number var to the course link/path. Seems to be working OK now : )
0
Back Up Your Microsoft Windows Server®

Back up all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

 

Author Comment

by:freshwaterwest
ID: 39677184
No - still having the issue although now I can simply refresh the window once or twice and it seems to work which is an improvement : )
0
 
LVL 83

Accepted Solution

by:
Dave Baldwin earned 500 total points
ID: 39678493
It sounds to me more like a timing problem where some data isn't available as quickly coming from the live server as it is from your own computer.
0
 

Author Comment

by:freshwaterwest
ID: 39678533
Hi Dave, I think I've sussed this out and yes it appears you are right with the timing suggestion. What I've done is put a slight delay in loading the SCO so it gives the rest of the container files chance to load properly. Before doing this I had also initially nullified some javascript cache variable values inside the LMS code which seemed to improve things.
thanks for your help - I'll award the points as you have actually hit the nail on the head.
0
 

Author Closing Comment

by:freshwaterwest
ID: 39678534
Good thinking - thanks for the suggestion
0
 
LVL 83

Expert Comment

by:Dave Baldwin
ID: 39678575
You're welcome, thanks for the points.
0

Featured Post

MIM Survival Guide for Service Desk Managers

Major incidents can send mastered service desk processes into disorder. Systems and tools produce the data needed to resolve these incidents, but your challenge is getting that information to the right people fast. Check out the Survival Guide and begin bringing order to chaos.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

It is possible to boost certain documents at query time in Solr. Query time boosting can be a powerful resource for finding the most relevant and "best" content. Of course the more information you index, the more fields you will be able to use for y…
These days socially coordinated efforts have turned into a critical requirement for enterprises.
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

733 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question