php - Lighttpd caching shell_exec() output? -


i have php script runs external process.

the external process outputs json string data system changes every , then.

when run external process can see json string different every time run it.

however, when call php script using ajax web browser json string not updated after first call php script.

the time json string gets updated if refresh page or run external process manually while i'm inside website.

why happening?

does lighttpd cache output?

edit:

here's lighttpd config file content:

server.modules = (     "mod_access",         "mod_cgi",     "mod_alias",     "mod_compress",     "mod_redirect", #       "mod_rewrite", )  server.document-root        = "/var/www" server.upload-dirs          = ( "/var/cache/lighttpd/uploads" ) server.errorlog             = "/var/log/lighttpd/error.log" server.pid-file             = "/var/run/lighttpd.pid" server.username             = "www-data" server.groupname            = "www-data" server.port                 = 80   index-file.names            = ( "index.php", "index.html", "index.lighttpd.html" ) url.access-deny             = ( "~", ".inc" ) static-file.exclude-extensions = ( ".php", ".pl", ".fcgi" )  compress.cache-dir          = "/var/cache/lighttpd/compress/" compress.filetype           = ( "application/javascript", "text/css", "text/html", "text/plain" )  # default listening port ipv6 falls ipv4 port include_shell "/usr/share/lighttpd/use-ipv6.pl " + server.port include_shell "/usr/share/lighttpd/create-mime.assign.pl" include_shell "/usr/share/lighttpd/include-conf-enabled.pl"  $http["url"] =~ "/cgi-bin/" {         cgi.assign = ( "" => "" ) }  cgi.assign      = (         ".cgi"  => "" ) 

edit

according following google product thread person called johnjbarton mentions following:

ok spoke chrome cache expert. problem in case described on bug: bug 30862 - dynamically inserted subresources aren't revalidated when containing document reloaded https://bugs.webkit.org/show_bug.cgi?id=30862

the force-refresh forces resource loaded in outer page. not force refresh on xhr loaded resources. pretty of resources in dojo app.

when @ console of chrome under network section says of requests website making of type xhr.

can somehow related?

edit

the headers of request are

accept */*

content-type application/x-www-form-urlencoded

very important edit edited php script appends results of process executes in log file.

it turns out output of process same.

however when run process manually changes expected.

it seems me if lighttpd caching output of process executes.

edit

this php script looks like:

<?php session_start(); if(!isset($_session['user'])){     header("location: /"); } else {     header('content-type: application/json');     $output = shell_exec('/home/debian/myprocess/myprocess');     file_put_contents("/var/log/lighttpd/access.log", $output, file_append | lock_ex);     echo $output; } 

?>

ok, found cause of problem.

the process executing call myprocess runs process called iwlist.

iwlist seems require run root.

since php script executes any process lighttpd server user called www-data, process myprocess executed www-data in turn tries execute iwlist www-data well, , failed.

my solution run myprocess through daemon dumps output of myprocess file php script can read.

this works perfectly. `


Comments

Popular posts from this blog

gridview - Yii2 DataPorivider $totalSum for a column -

java - Suppress Jboss version details from HTTP error response -

Sass watch command compiles .scss files before full sftp upload -