Example: implementing static caching for dynamic web pages _ PHP Tutorial

Source: Internet
Author: User
Instance: implements static cache for dynamic web pages. Example: implement static cache source for dynamic web pages dynamic web page title instance: implement static cache for dynamic web pages titleh3 instance: implement static cache for dynamic web pages h3pchtmlfore instance: implement static cache for dynamic web pages

SOURCE Dynamic webpage

 
 
  1. Instance: static caching of dynamic web pages
  2. Instance: static caching of dynamic web pages

  3. @ {Int :@{ for: getSuffix} + 1 }-
  4. @ {Int :@{ for: getSuffix} + 1 }-

(Example File: _ samples/file_page.html)

Read cached static file information

 
 
  1. WEB-INF/cache/page_test.html

Determine whether a static file exists

 
 
  1. page
  2. cache

If yes, the cache is called. If no, the page is called.

 
 
  1. page
  2. cache

You can call label cache to read cached files.

 
 
  1. WEB-INF/cache/page_test.html

Callable labelsPage

 
 

Introduce the dynamic web file @ {sys: curpath‑file_page.html and save it as a WEB-INF/cache/page_test.html file

Show cache content

@ {File: page}

Complete Code

 
 
  1. WEB-INF/cache/page_test.html
  2. page
  3. cache
  4. WEB-INF/cache/page_test.html
  5. @{file:page}

Effect

(Example File: _ samples/file_cache.html)

Try it now!

Dynamic Source dynamic web page title instance: static cache for dynamic web pages/title h3 instance: static cache for dynamic web pages/h3 p chtml for e...

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.