• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 613
  • Last Modified:

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

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
freshwaterwest
Asked:
freshwaterwest
  • 5
  • 3
1 Solution
 
Dave BaldwinFixer of ProblemsCommented:
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.
1
 
freshwaterwestAuthor Commented:
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
 
freshwaterwestAuthor Commented:
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
Veeam Disaster Recovery in Microsoft Azure

Veeam PN for Microsoft Azure is a FREE solution designed to simplify and automate the setup of a DR site in Microsoft Azure using lightweight software-defined networking. It reduces the complexity of VPN deployments and is designed for businesses of ALL sizes.

 
freshwaterwestAuthor Commented:
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
 
Dave BaldwinFixer of ProblemsCommented:
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.
1
 
freshwaterwestAuthor Commented:
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
 
freshwaterwestAuthor Commented:
Good thinking - thanks for the suggestion
0
 
Dave BaldwinFixer of ProblemsCommented:
You're welcome, thanks for the points.
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 5
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now