Is the content of the image file returned in PHP not a burden on many servers? Is there a good way to protect private albums?
I am a beginner of PHP, with the Zend Framework, now there is a problem, to make a photo album,
Can be set to non-public, the picture is saved in the file system,
My idea is that the public picture is placed in the folder of the open, anyone can directly browse, do not need PHP processing.
If the user's private album, the URL of the picture is under the control of the Zend Framework, I log in to see.
But the content of this picture file needs to be returned dynamically in PHP? Will it increase the burden on many servers?
Is there any good way? Can Apache's mod_rewrite be controlled?
------Solution--------------------
Security generally requires sacrificing performance
Read by PHP is one of the simple protection methods
You can choose to apply only to confidential files
Others are read directly with Web server
------Solution--------------------
So that users can not access directly.
There's no absolute secrecy.
Spend more time making it easier for users to take care of the password.
such as limit password retry times, etc.
------Solution--------------------
But the content of this picture file needs to be returned dynamically in PHP? Will it increase the burden on many servers?
Yes, to dynamically return, will increase the burden to a certain extent, because to deal with, to account for the memory
Is there any good way? Can Apache's mod_rewrite be controlled?
Override can not be controlled, as long as you can see in IE, rewrite can still see, only login verification shows the PHP output line!
You see CSDN's personal pictures, are not protected!
------Solution--------------------
Security is about sacrificing some of the performance, but these performance is not very large.
Rewriting does not solve the problem, because it cannot be judged, it is just a regular expression.
Use PHP to control the output of the picture, before using PHP to determine whether to log in, whether there is permission, and then output, this is the logic, you can make a program based on this logic.
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.