Prevent (stop) Apache from registering certain AJAX / XmlHttpRequests?

I am working on a site where the main idea is to do a lot of xmlHttpRequests in a loop (or as a loop). But the fact is that every time I access a file on my server with javascript , it is logged in the log on the server . Over time, the access log file becomes so large that it slows down further requests.

Is there any way to tell apache (I think) not to register access to this file if it is correct? (I am sending a request with a password (always different) to this file.) The file will be accessed from different IP addresses. I do not want to stop all entries, only "approved".

+5
source share
1 answer

No problems. Just look at an example from the Apache documentation (a place where you might want to see if you have a question about Apache in the future). For instance:

# Mark requests for the AJAX call
SetEnvIf Request_URI "^/myajaxscript\.php.*$" dontlog
SetEnvIf Request_URI "^/myotherajaxscript\.php$" dontlog
# Log what remains
CustomLog logs/access_log common env=!dontlog
+9
source

All Articles