vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   Caching data (https://vborg.vbsupport.ru/showthread.php?t=156910)

Floris 09-03-2007 09:14 AM

Caching data
 
Ok, so I have a script now that I can call as a standalone (blah.php?show=x) which lets me query a remote site tvrage.com for show X. Yay.

This info is going to be shown in the forum that has tv show notes, so the info like next episode, and air date is listed. Of course, we dont' want to trigger this each time a user browses to the page. So it has to get it once, store it in a table:forum field with a timestamp and then check if it has been say .. 12 or 24 hours, before it does a remote query again (and if the time hasn't passed yet, use the existing data).

Now, how do I best approach this? We have about 50 forums, one for each tv show, so we're trying to keep the query count a bit low. I am curious what your thoughts are. Oh, we're already using a plugin to get data from the forum into the tvshownote box. You can check it as example here http://wetalk.tv/heroes/

Thanks for your help.

Dismounted 09-03-2007 11:41 AM

Well, the optimum solution (in my opinion) would be to run a *nix cron every 12/24 hours to query for the info, then store it in the local database. All you would have to do then would be to query the local database for the info.

Floris 09-04-2007 12:24 PM

Thanks for the info.

Princeton 09-04-2007 01:30 PM

I'm assuming you want to use this "data" as the forum description or in addition to forum description ...

if so, you can append parsed to forum description and save as description OR you can create a new forum field and save the parsed info there

if you opt to create a new forum field make sure you are able to edit the field via the Forum Manager (under Description) - this will allow you to edit the data if needed


All times are GMT. The time now is 01:00 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.02163 seconds
  • Memory Usage 1,713KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (4)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete