The main attack mode of PHP website:
1. Order Injection (Command injection)
2. Eval Injection (eval injection)
3. Client-side scripting Attack (script insertion)
4. Cross-site scripting attacks (Scripting, XSS)
5. SQL injection attack (SQL injection)
6. Cross-site request forgery attack (forgeries, CSRF)
7. Session hijacking (Sessions hijacking)
8, session fixed attack (session fixation)
9. HTTP response Split attack (HTTP Response splitting)
10 Files Upload Vulnerability (file Upload Attack)
11. Directory Traversal Vulnerability (directory traversal)
12. Remote file contains attack (inclusion)
13. Dynamic function Injection Attack (Variable Evaluation)
14. URL attack (URL attack)
15. Form submission Spoofing attack (spoofed form submissions)
16. HTTP request Spoofing Attack (spoofed HTTP requests)
What are the main caching technologies for PHP:
1, full-page static cache;
That is, the page is all generated HTML static page, the user accesses the static page directly, but not to go to the PHP server parsing process.
2. Page Partial cache
In this way, the infrequently changed parts of a page are statically cached, and the frequently changing blocks are not cached, assembled and displayed together, can be implemented in a way similar to ob_get_contents, or can take advantage of page fragment caching policies like ESI, The cache used to make a relatively static fragment portion of a dynamic page (ESI technology, please Baidu, here is an unknown).
This method can be used for product pages such as the mall;
3. Data cache
As the name implies, is a way to cache data, for example, a product information in the mall, when the product ID to request, will be included in the store information, merchandise information and other data, this can be cached in a PHP file, the file name contains the product ID to build a unique mark The next time someone wants to view this product, the first thing is to directly tune the information inside the file, instead of going to the database query; in fact, the cache file is a PHP array.
Ecmall Mall system inside the use of this way;
4. Query cache
In fact, this with the data cache is a way of thinking, is based on query statements to cache, the query to get the data cached in a file, the next time you encounter the same query, directly from the file to adjust the data, will not check the database, but the cache file name here may need to use a query statement as the base point to establish a unique;
Cache by Time Change
In fact, this is not a true caching method, the above 2, 3, 4 of the cache technology is generally used in the time to change the judgment, that is, for the cache file you need to set a valid time, in this effective time, the same access will first take the contents of the cache file, but more than the set cache time, You need to re-fetch the data from the database and produce the latest cache files; For example, I will be the first page of our mall is set up 2 hours to update;
5. Cache by content Change
This is not an independent caching technology, need to be combined with, that is, when the database content is modified, immediately update the cache file;
For example, a large number of shopping malls, a lot of goods, commodity tables must be relatively large, the pressure of the table is also heavier; we can cache the product display page;
When the merchant changes the information of this product in the background, click Save, we update the cache file at the same time, then, when the buyer accesses this product information, it actually accesses a static page, and does not need to visit the database again;
Imagine, if the product page does not cache, then each visit to a commodity will go to the database to check once, if there are 100,000 people online browsing products, the server pressure is big;
6. In-Memory cache
The first thing you can think of is that memcached;memcached is a high-performance distributed memory cache server. The general purpose is to reduce the number of database accesses by caching database query results to improve the speed and scalability of dynamic Web applications.
7. Memcache Redis
8. Time-Triggered cache
Continue to update!!!!!!!!!!!! tomorrow
PHP Summary two articles