1
ceca69
clear cache from code
  • 2008/6/27 9:11

  • ceca69

  • Just popping in

  • Posts: 8

  • Since: 2003/9/29


Hi!
I have created a module and currently I'm not using any cache.

I want to switch ON the cache but I want also to be able to 'refresh' the cache of a specific template from php code (from an admin page), is it possible?
Can anyone suggest me how to do it ?

I had a look to the core of XOOPS and I found this command:
$xoopsTpl->clear_cache('db:th_std_all_matches.html')

I tried but is not working,I mean the page is still cached.

thanks in advance
Carlo

2
FaYsSaL
Re: clear cache from code
  • 2008/6/27 10:30

  • FaYsSaL

  • Not too shy to talk

  • Posts: 115

  • Since: 2006/1/2 2


hello,try to install xoopscare(instant-zero)
it has an option for this and for templates_c too

fayssal

3
noo-b
Re: clear cache from code
  • 2008/6/27 12:41

  • noo-b

  • Just can't stay away

  • Posts: 456

  • Since: 2007/10/23


I Love Xoops

4
ceca69
Re: clear cache from code
  • 2008/6/27 12:58

  • ceca69

  • Just popping in

  • Posts: 8

  • Since: 2003/9/29


Hi, I'm talking to clear the cache of a specific page not all of them.



However after some tests I found this command:

include_once XOOPS_ROOT_PATH.'/class/template.php';
$xoopsTpl = new XoopsTpl();
$xoopsTpl->clear_cache(null,null,'12514');


where the number 12514 is the field tpl_id in the table xoops_tplfile

with a little extra work you can customize your admin part of the module to 'clear' the cache for a specific pages.


Furthermore if you want to 'clear' all the cache of your website it is enough to run:

include_once XOOPS_ROOT_PATH.'/class/template.php';
$xoopsTpl = new XoopsTpl();
$xoopsTpl->clear_all_cache();


carlo

Login

Who's Online

177 user(s) are online (103 user(s) are browsing Support Forums)


Members: 0


Guests: 177


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Nov 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits