Load time pondering - Images and Domains - html

So I'm in the process of adding links to images on my web site, and I've come across something interesting.
All the images I'm linking to are housed on another domain, but this domain happens to be located on the same server as the site I'm working on. Now normally I would download images from the other domain and place them in my website's directory structure, so as to avoid having to connect to another server and thus save on load time when grabbing the images on page load. But in this case, with the two file structures being located on the same server, I wonder if the time to download the images on page load would be virtually the same with absolute linking to the 'sibling' domain versus storing the images on my site itself.
Does anybody know if this is the case?? Thanks :)

I think here's where your thinking goes astray:
Now normally I would download images from the other domain and place
them in my website's directory structure, so as to avoid having to
connect to another server and thus save on load time when grabbing the
images on page load.
This is not true. It doesn't save load time to have all the images on the same server. The browser is the client making the request for the image. The server to which the browser makes the request doesn't matter.

Related

How to make pictures on server be visible on website associated with the server?

Currently, there are gigabytes of images stored on a server that I can access using username#serverip. It is not my server, but I have access to it. Using cd Storage followed by ls -l shows all the files that I would like to be able to be accessible to anyone who visits the actual website. However, all of those files, while they are on the server, are not visible on the website and I was wondering how I could go about doing that. Is there a way to make the files on the server be visible on the website as well?
Are these images? Or just assorted files?
In either case, and without knowing what your actual implementation of the website, generally all webservers have a static resources folder.
In this folder you would put things like your general website images, like favicon, etc.
Put all that stuff in there. Or configure the webserver to use the existing one as such. This is not necessarily best practice though as all of those items would be exposed (potentially) without authentication.

How to get file contents of old site on drupal?

We have a site running to drupal and migrated it to Squarespace. I have to retrieve some pages of drupal site but I can no longer view the site. Do you know any way to get the old content of website on drupal? Please know that we still have access to the drupal box. Any suggestions will be a big help.
Easiest way would be to make the old Drupal site available again through the browser running on a different domain like old.example.com, login into the admin panel and start copy/pasting content.
If you know your way around your computer, know the IP address the old server is running on you could for the time being change the host file of your machine to send requests for your site to the old server and get access to the site that way.
Migrating content by automating the process is also an option, but it is not only time consuming, it requires in depth knowledge of both platforms so is mostly a very expensive solution if you are not able to do this yourself.
But if I read your question, I think the first option is the easiest option. Get a hold of the technical person/party of the server the site is running on and get them to make the site accessible on a different domain.

Loading image onto a website from url instead of database

Could loading images from a url create potential security or performance issues that would not be a factor if you had loaded the image from a database?
No, that's not true .And one important thing image will load faster if you load it from url instead of database.

Upload images on mysql

I am working on a social networking site and i would like some help. I want the users of the site to upload images on mysql database. (I am using jsp pages). Any ideas?
You can, although it's generally a bad idea.
It's better to store the images somewhere on your server and store the image's path in the database instead, where you can save it along with other data (e.g. information regarding the uploading user).
If you insist, store it using this type:
http://dev.mysql.com/doc/refman/5.0/en/blob.html
Here's an example.

How will a CDN work with my site?

I have tried to look for answers for my question but haven't found anything conclusive.
I have a site which, among other things, stores member pictures & thumbnails. They are in separate directories, and within each directory are a cascade of folder names based on properties of the image. This is to prevent thousands of images being in one directory for performance reasons.
for example, a typical image has a URL like:
www.mysite.com/thumbs/100x75/04/18/s3hf9sj_939swzl.jpg
The file location and name are stored in a mysql database so they can be dynamically displayed.
How would a CDN be implemented for my images? Can I recursively select all the images in a directory to be uploaded to the CDN? How often would it update this file information?
And finally, what might happens when the database retrieves a url like the one above? Will the CDN automatically redirect the user to something like this?
www.cdn.mysite.com/thumbs/100x75/04/18/s3hf9sj_939swzl.jpg
Or will I have to design my database differently?
Thank you.
If you choose to migrate to a CDN and not change your URL scheme you would have to make sure requests to www.mysite.com/thumbs/ are routed to your CDN (at www.cdn.mysite.com/thumbs/).
You also need to change your method of saving images to also save a copy to the CDN, or you could create a synchronization script to run periodically, but then you would need to serve your resources from two locations; from your own if the file is not present on the CDN, which would increase the complexity of your setup.
I would make sure I store my resources directly at my CDN at the same time I backup locally and would migrate to a separate domain form my CDN (to allow more concurrent downloads from the user).