Ron
Ron

Reputation: 255

How to clear all caches in Apache?

I have a django app running in a virtualenv on Windows 10 WSL1 (Ubuntu). The python version is 3.6.8.

When using the django development web server, python manage.py runserver, everything is fine. I access that with http://localhost:8000/<my app name>/

But when using apache2, version 2.4.29, months-old javascript code shows up in the browser debugger in a VMxxx file (though I haven't yet found an eval() that supposedly is the cause of the VMxxx being generated).

Also, old server-side code shows up: an old javascript error that resulted from the django python code sending the wrong content type - a bug that was fixed a couple of weeks ago.

I'm accessing apache2 with http://localhost/<my app name>/

I disabled mod_cache:

a2dismod cache
Module cache already disabled.

Also ran htcacheclean -r -l1k and manually looked at the page cache directory, which was empty.

I clear the Chrome cache on every page load, but also get the same errors when using a different browser (Firefox) that wasn't even installed when this old code that's showing up was written.

I put in a HTTP header to request no caching: <meta http-equiv="Cache-Control" content="no-store" />

The closest thing to a cache that I have configured in Django settings is SESSION_ENGINE = 'django.contrib.sessions.backends.cached_db', no CACHES settings.

And, of course, I stopped and restarted Apache.

service apache2 stop
service apache2 start

All to no effect.

Where is this old code coming from?

Upvotes: 1

Views: 26229

Answers (1)

Ron
Ron

Reputation: 255

Duh! I had copied (not moved) the entire directory tree to a different location, but didn't update the apache2 configuration, so it was still pointing to the old location.

I'm leaving this up in case someone else makes the same mistake.

Upvotes: 5

Related Questions