| | |||||
| ||||||||
| Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics. |
![]() |
| | LinkBack | Thread Tools |
| | THREAD STARTER #1 (permalink) |
| Web Marketing Specialist Join Date: Oct 2003 Location: Texas, USA
Posts: 1,335
![]() ![]() ![]() | How to cookie images I have a client that has alot of reocurring images on different pages. Right now, they have to load every time. I want to make them cookie or whatever, so it only has to actually load one time so that hen he visits other pages with the same images, its already loaded...c an you do that? and i dont think i am talking about preloading images.. i dont think |
| |
| | #2 (permalink) |
| NamePros Member Join Date: Aug 2003 Location: Ontario, Canada
Posts: 98
![]() | Browsers automatically do that, it's called caching. ????: NamePros.com http://www.namepros.com/programming/15691-how-to-cookie-images.html When a browser visits a page, they find the address of the image and download it into the temporary internet folder. If you visit another page with the same image, the browser will realise this and get the image from the harddrive rather than from the web server. If your images have to load every time, check your code. One of two things may be happening here. 1) Your website automatically generates a new image every time you visit a page (PHP or CGI .gif construction). If this is the case GET THAT OUT OF THERE!!! Not only does that take up MASSIVE amounts of memory on the server, it also makes what you want to do impossible. 2) You have a META header or something of the sort on your page telling the browser not to cache. Take these out, and your problems are solved.
__________________ Yeah... I knew that. What? |
| |
| | #3 (permalink) |
| NamePros Member Join Date: Nov 2003
Posts: 38
![]() | IN addition to what MP) said.. if you are using a graphics program to make the pages, such as Dreamweaver, or Adobe, or Ulead they will make duplicates of the same image for each unique page name.. for example if you have a graphic on the home page, page 2, and page 3, and its the same exact graphic, the program will name the graphic a different name for each page.. like index_01, page2_01, page3_01.. etc.. so you have three of the same graphic.. you can go back through your code and rename all the IMG= stuff to the same index_01 or whatever so the browser only chaches the image once instead of loading it new for each page visited. did that make any sense? sorry if it didnt.. I am no linguist. have fun!
__________________ NetButch ... Catch Your Audience! www.netbutch.com |
| |