×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Newbie Apache Cache Question

Newbie Apache Cache Question

Newbie Apache Cache Question

(OP)
I'm not great with web servers, and I'm especially new to Apache. (The only other web server I used was Abyss in Windows.)
I copied a couple html files from my old Windows drive to the Linux Apache directory. Loaded it. Realized I needed to update a path to a JS file. When I refreshed, I saw no change. I pressed Ctrl+U to see the page source. The path had not been updated. Ok. I figured it must be pulling from cache. I pressed Ctrl+F5 to pull from disk. No change. How do I flush Apache cache?
I also wouldn't mind disabling it altogether because I don't see the point of caching on localhost.

RE: Newbie Apache Cache Question

Hi

Are you sure ? I can not remember in ~20 years of using Apache I ever had caching issue.

To start with warmup questions :
  • How you installed Apache ?
  • What do you mean by "the Linux Apache directory" ?

Feherke.
feherke.github.io

RE: Newbie Apache Cache Question

(OP)
No I'm not sure upsidedown. I'm still quite new to this...
I actually don't remember how I installed Apache. I don't remember if it just came with my distribution of Mint, or if I did "sudo apt-get install apache2" afterward.
For the directory, I just meant the main directory where I'm supposed to put my html files, which in Linux is apparently:
/var/www/html

RE: Newbie Apache Cache Question

Hi

Quote (AbidingDude)

I don't remember if it just came with my distribution of Mint, or if I did "sudo apt-get install apache2" afterward.
Ok, the reason I asked was to know whether you used some spooky 3-in-1 LAMP installer, which may add obscure configurations.

Quote (AbidingDude)

For the directory, I just meant the main directory where I'm supposed to put my html files, which in Linux is apparently:
/var/www/html
Yes, that used to be, though the precise answer is whatever is specified with the DocumentRoot directive.

Tried with a Mint live CD now :
  • Installed the apache2 package, made no configuration
  • Created a test.html and a test.js file in /var/www/html, with test.html referring to testosterone.js
  • Loaded http://localhost/test.html, the document appeared as expected
  • Edited test.html to refer to test.js
  • Hit Ctrl-F5, the document was reloaded with the modifications made by JavaScript visible
No idea what could be wrong there, just some dumb questions :
  • Are you sure the URL you use to access the page is correct ?
  • Are you using a plain text editor that certainly does no backup, versioning or similar thing the could send the content to other file than you expect ? ( Personally I used MCEdit, the Midnight Commanders's builtin editor. )
  • Are you editing the file on the local file system ? ( I mean, not through network on shared drive. )

Feherke.
feherke.github.io

RE: Newbie Apache Cache Question

Cache is something that can be affected at both the client and server side. Without knowing exactly what is happening here (or in any other caching scenario), the standard practice is to append a GET variable to the end of your file reference. In your HTML, change "myscript.js" to "myscript.js?t=3". This typically tricks both servers and clients into sharing a fresh version of the file.

RE: Newbie Apache Cache Question

(OP)
Apparently I was mistaken. The change I made to the script path was too subtle. The reason I thought the change had no effect was because when I hit Ctrl+U to view the page source, it was the source before the change, so I thought it was the old page loading.
Just now I changed the CSS. I changed the background color from
rgb(20, 20, 20)
to
rgb(50, 0, 10)
then I refreshed the page and saw immediately that it changed to a dark red. But the strange thing is that when I hit Ctrl+U again, the source that popped up was the old one with the previous color.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close