Does PHP increase the burden on servers to return image files? Is there a good way to protect private albums? Solution

Source: Internet
Author: User
Tags password protection
Does PHP increase the burden on servers to return image files? Is there a good way to protect private albums? I am a beginner in PHP and use ZendFramework. now I have a problem. to create an album, you can set it to not public. images are saved in the file system. my idea is, public images are placed in the public folder. anyone can browse them directly without php processing. If it is a user's private album, will the image url be controlled in the zend Framework and the content of the image file returned by PHP increase the burden on the server? Is there a good way to protect private albums?
I am a beginner in PHP and use Zend Framework. now I have a problem. I want to create an album,
It can be set to not public. images are saved in the file system,

My idea is that public images are placed in the public folder. anyone can browse them directly without php processing.
For a user's private album, the image url is under the control of the zend Framework and can be viewed only after I log on.

But the content of this image file needs to be dynamically returned using php? Will it increase the burden on many servers?
Is there any good way? Can mod_rewrite of apache be controlled?



------ Solution --------------------
Security generally sacrifices performance.
Php reading is a simple protection method.
You can choose to apply only to confidential files

Others are directly read using web server

------ Solution --------------------
So that users cannot directly access it.
No absolute confidentiality

It takes more time for users to pay attention to better password protection.
For example, limit the number of password retries
------ Solution --------------------

But the content of this image file needs to be dynamically returned using php? Will it increase the burden on many servers?

Yes. to dynamically return data, it will increase the workload to a certain extent, because it will occupy the memory for processing.


Is there any good way? Can mod_rewrite of apache be controlled?

Rewriting cannot be controlled. as long as you can see it in IE, you can still see it after rewriting. only the PHP output can be displayed in login verification!

You can see that CSDN's personal images are not protected!


------ Solution --------------------
Security is to sacrifice some performance, but these performance will not be very high.

Rewriting cannot solve the problem, because it cannot be judged. it is just a regular expression.

Use PHP to control the output of images. use PHP to determine whether to log on, whether to have permissions, and then output images. this is the logic. you can create a program based on this logic.

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.