Questions about the cache of the Smarty Template

Source: Internet
Author: User
About the cache of the Smarty template. I enabled the cache requiredirname (_ FILE _). '/run. inc. php'; global $ _ tpl; if (! $ _ Tpl-& gt; is_cached ('member. tpl', $ _ SERVER ['request _ URI ']) {$ _ m about the cache of the Smarty template.
I enabled cache
Require dirname (_ FILE _). '/run. inc. php ';
Global $ _ tpl;
If (! $ _ Tpl-> is_cached ('member. tpl', $ _ SERVER ['request _ URI ']) {
$ _ Member = new MemberAction ();
$ _ Member-> action ();
}
$ _ Tpl-> display ('member. tpl', $ _ SERVER ['request _ URI ']);
$ _ Tpl is the smarty template and MemberAction () is the controller. In simple terms, it is in member. php? Action = showupdate: the file data is modified so that it jumps to member. php? Action = show, but because of the cache relationship, it directly loads member. php? Action = show cache file in member. php? Action = show does not see the data changes, but the database data is modified. I want to know how to update data in a timely manner. the modified part is not cached.

------ Solution --------------------
Smarty has a tag that is not cached {insert}

Another method is member. php? Action = after showupdate is executed, call the smarty method to update member. php? Action = show cache

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.