Solved

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

Posted on 2013-11-26
8
548 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
  • 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
 

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
Control application downtime with dependency maps

Visualize the interdependencies between application components better with Applications Manager's automated application discovery and dependency mapping feature. Resolve performance issues faster by quickly isolating problematic components.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

If you've heard about htaccess and it sounds like it does what you want, but you're not sure how it works... well, you're in the right place. Read on. Some Basics #1. It's a file and its filename is .htaccess (yes, with a dot in the front). #…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

920 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now