Hi,
I guess you would want something automatic, rather than manually flushing just the prices?
Something you can currently do with the plugin is to turn off ‘Live Data’ in the options page, then when you insert a product into a post it populates the shortcode with data fetched at the time of insertion. Then just need to delete items from the shortcode that you want to be fetched ‘live’ and add the option ‘live=1’ to the shortcode.
e.g.
A completely live link, all data fetched on cache refresh:
[amazon asin=B006O6FGTE&template=wishlist&live=1]
A completely static link, all data provided in shortcode:
[amazon asin=B006O6FGTE&template=wishlist&title=Barbie Dolls of the World W3374 Mexico Doll - Pink Label Collection&artist=Mattel&manufacturer=Mattel&thumb=https://ecx.images-amazon.com/images/I/51vVrSgebbL._SL160_.jpg&rank=92424&rating=-&price=£20.89&live=0]
A partially static link, all but price provided in shortcode, ‘price’ is fetched on cache refresh – set cache age to 2 hours:
[amazon asin=B006O6FGTE&template=wishlist&title=Barbie Dolls of the World W3374 Mexico Doll - Pink Label Collection&artist=Mattel&manufacturer=Mattel&thumb=https://ecx.images-amazon.com/images/I/51vVrSgebbL._SL160_.jpg&rank=92424&rating=-&live=1]
Obvious problems with this are:
- Harder to put links in the posts in the first place
- Localised data is not provided
- Changes to product details are not picked up (do they ever change?)
- Changing the template content (e.g. adding a new keyword) will be missing from all your shortcodes
As for making this a new feature of the plugin…
Options include:
- Always exclude price data from the cache, so it is fetched on every page view – probably too slow.
- A background task that refreshes the price data in all cached items every few hours – feasible, but a bit limited
- Split the cache into ‘Permanent’ data and ‘Live’ data, the ‘Live’ data is fetched more frequently – perhaps ultimately making the ‘Permanent’ data an editable database – probably the way I’d like to go but quiet a major change in functionality
Needs some thought!
Paul