Tuesday, 2 August 2016

Nifty Slideshows - improved speed to first slide display

I've spent the best part of today removing Nifty Slideshow's dependence on the Google script widget that it's been using until now.

The script widget's purpose was to change all links in a Zazzle RSS feed's content so they included the given tracking code, the given voucher code and to change the thumbnail size.

Today I managed to penetrate the inscrutable-until-now data structure and call-backs of the Google Slideshow widget the whole thing is based on. That allowed me to make the tracking code, voucher code and thumbnail size changes entirely within the Nifty Slideshow Javascript and so bye-bye to the Google script.

This is good from three perpectives:
  • one less link in the chain of requests and responses going from Nifty to Zazle and back, so things speed up some under normal conditions
  • overall, one third the chance now of that chain getting broken when there are glitches at the Google widget end or the Zazzle RSS feed mechanim end of things
  • Google operate a quota system on Google scripts. When they are exceeded, the script stops working until the next period starts. As Niftys become more popular there was going to come a time when this would be a problem. Not any more :)

Updated tools so far:

  • Nifty Slideshow maker pages
  • Nifty Slideshow displayer page (for social media links)
  • The generated code snippet for putting Niftys on web sites / blogs
  • Staging-NS
The last three of the above are all availble via the Nifty Slideshow maker page. Exisitng Niftys shared on socail media will use the updated version of the displayer page and therefore immediately get all the benefits of the new approach.

Still to do:

  • Marvin maker page Done
  • Marvin dislayer page Done
  • The generated code snippet for putting Marvins on web sites / blogs Done
Those last three should be done in the next few hours / day. 

Other updates swept up on the way:

  • Niftys now consistently respect international domains by not including US-only products for non-US visitors
  • The number of products in collection-based slideshows now respects the &ps= setting
  • The removal of US-only products happens after the &ps= has been accommodated.
    This means you may end up getting fewer in your slideshow than requested, even though there may be more non-US products that would otherwise be avaliable.
As above, these still need to be done with Marvin. Not applicable