What is the difference between static pages and memcached?

Source: Internet
Author: User
Daniel, I am sorry, I do not understand PHP, I do Java, because Java also has memcached, I have a certain understanding of Java memcached. Our company is to do a mobile application, the server is PHP to do, but do PHP to improve the efficiency of the static page to do, but the problem came, he put all the logic functions are thrown to the mobile phone to do, mainly my mobile phone processing a large number of business, optical database table I was on the phone side of the new 20 more, As a mobile phone developer, such stability is certainly worse. I suggested that he do it with memcached and let him share some business logic. Mainly I do not understand the static page, can I tell the difference between static pages and memcached? What are the pros and cons? I'm just ready to propose with the manager.

Reply to discussion (solution)

Persistence comparison
Static pages are placed on the hard disk, and the contents of the memcached are placed in memory.
Static pages, the server shuts down or restarts, the content does not disappear.
Memcached because it is placed in memory, the reboot disappears.

Extensibility Comparison
Static pages can only be read natively, and this static page needs to be generated on each server if all servers are required to read them.
Memcached can be shared and read and written by multiple machines.

using the Compare
For example there is a page content that is Hello World
The way to use static pages is to generate a 1.html content that is also Hello world.
The Memcached method is to put the content of the Hello World page in memcached, accessed, and then read from memcached.

To add, static pages and memcached are all designed to reduce database stress. So the content of both does not need to be persistent.
Persistent data should be done at the database level.

If you have only one server, it is recommended to use a static page, because memcached requires network overhead.
If you are in a multi-machine environment, memcached is recommended.

Two concepts, basically although there is a common place but in essence there is a difference. Do not know what your problem is, you do mobile phone is just a front desk, data processing by PHP to solve. This is must be divided clearly, PHP also do what, do data management part. The result of data output, data management.
Others do the front-end do not go so much, this must be clear with your manager. What do you mean by throwing a bunch of stuff in a user's cell phone?

Thank you two enthusiastic Daniel, listened to your explanation, in the mind has a concept ...

  • 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.