Step 44 – Basic Structure of the Caching RTE

Time to sketch out the structure of my caching RTE code. Just to recap, here’s the current version of the VSSCORM RTE which has no caching mechanism – all transactions are immediately reflected in the persistent storage (LMS database).

nocache

In the new version, I’m going to create a set of JavaScript variables to act as a cache for local responses to LMSSetValue() and LMSGetValue() calls.

withcache

The server-side setValue.php and getValue.php functions will no longer be needed – all LMSSetValue() and LMSGetValue() API calls will interact with the cache on the client side (the browser) – but I will need to create a new commit.php function to handle the LMSCommit() API call.

Finally, I need somewhere to locate this cache and, rather than create another document/file/frame, I’m going to locate it in the header of the ‘api.php’ file. This makes sense because it’s also where the LMSSetValue and LMSGetValue functions are implemented.

Next time – create the cache code in api.php.

Be Sociable, Share!
This entry was posted in Run Time Environment. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *