Smarty in the setting off the cache can be in the specified file with the cache?

Source: Internet
Author: User
Smarty in the setting off the cache can not be specified in the file with the cache?
Did a small function, Online_count (), show the number of online, intermediate technology does not say, because this is a small project used, accuracy requirements are not high, but must be shown

$smarty-Assign ("Online_count", Online_count ());

I don't want to check on this statistic. function Online_count () for online numbers;

In config, you have set the
My config.php.

$smarty = new Smarty ();
//....... Skip Over

Number of people online
$smarty-Assign ("Online_count", Online_count ());


Is it possible to set the Online_count variable to cache?
Why do you put this on config.php assignment?
Because my online number is displayed in the header and the header does not have PHP, only the template, and there is no PHP $smarty-and display () This header.html templates
Are all introduced in other templates {include file= "common/header.html"}

Excuse me, what else is the method?

Ignore this online number to cache up the request is unreasonable, on the technical level can have what method to solve?
------to solve the idea----------------------
You can do the cache in Online_count this function.
  • Related Article

    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.