localhost does reflect changes in source file structures

Problems with the Windows version of XAMPP, questions, comments, and anything related.

localhost does reflect changes in source file structures

Postby Ironwolf » 14. April 2017 04:45

Hi, and thanks for any thoughts..

As a learner I am testing creating web pages using php files on localhost using XAMPP.

To check I understand file paths correctly i added a simple link to a pic in Index.php in htdocs:

<img src="/imagesxxx/inside_images/test-image-1.jpg" width="150" height="100" alt="test image 1" >

and it worked fine adding the image from the correct folder as had I placed it there.

To test I understand how the system works i moved test-image-1.jpg to another folder, then refreshed localhost, expecting
to find the picture place holder as localhost should have looked in the inside_images folder and not found the pic.
However, the picture still showed up as if all was correct.

I tried restarting my computer and going to localhost on Chrome, but still the picture showed up in the page as if it was in the correct folder.

What am I misunderstanding here?

Regards,
Stephen
User avatar
Ironwolf
 
Posts: 7
Joined: 14. April 2017 04:08
XAMPP version: 5.6.30
Operating System: Windows 10

Re: localhost does reflect changes in source file structures

Postby Ironwolf » 14. April 2017 07:26

CORRECTION: subject should read: "localhost does NOT reflect changes in source file structures"
User avatar
Ironwolf
 
Posts: 7
Joined: 14. April 2017 04:08
XAMPP version: 5.6.30
Operating System: Windows 10

Re: localhost does reflect changes in source file structures

Postby Altrea » 14. April 2017 08:03

Either it is cached or still accessible.
We don't provide any support via personal channels like PM, email, Skype, TeamViewer!

It's like porn for programmers 8)
User avatar
Altrea
AF Moderator
 
Posts: 11926
Joined: 17. August 2009 13:05
XAMPP version: several
Operating System: Windows 11 Pro x64

Re: localhost does reflect changes in source file structures

Postby Ironwolf » 14. April 2017 12:33

Thanks Altrea.
Yes that seems right. I tried going to Chrome history and deleting 'cached' images and files and it worked as expected.

Comment: given that the main purpose of XAMPP is to allow the quick testing of website pages and their supporting directory structure on your machine before you upload them to
a hosting site (I think that is the main idea), then having cached html/php docs or images affecting the processing of files in htdocs would seem to be a major flaw in the program's main purpose.

On the other hand I suppose the added step of deleting cached files before your final test is not that big a deal.

Maybe there is a SETTING somewhere which could stop cached files being activated for files processed by localhost?

Regards,
Ironwolf.
User avatar
Ironwolf
 
Posts: 7
Joined: 14. April 2017 04:08
XAMPP version: 5.6.30
Operating System: Windows 10

Re: localhost does reflect changes in source file structures

Postby Nobbie » 15. April 2017 00:17

Caching is done by your browser, not by Xampp. Xampp always sends the latest file, it is your browser which decides not to request the latest file. Even if there exist HTTP Header Options to tell the browser not to cache certain files, it is still the browser which may act as wanted or not. Therefore your comment looks kind of missplaced, as the browser is not part of Xampp.
Nobbie
 
Posts: 13170
Joined: 09. March 2008 13:04

Re: localhost does reflect changes in source file structures

Postby Ironwolf » 15. April 2017 04:14

Fair enough Nobbie.

Others coming upon this problem for the first time might find it useful to know:

Further research on caching, led me to find the Chrome extension: "Cache Killer" which seems an elegant solution to this problem. With one click you can force Chrome to clear the cache before loading any file. You can disable the extension to enable caching again when you have finished developing/testing. I tested it a couple of times and it works so far.

Regards,
Ironwolf.
User avatar
Ironwolf
 
Posts: 7
Joined: 14. April 2017 04:08
XAMPP version: 5.6.30
Operating System: Windows 10


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 123 guests