Lag in browser after editing script eg in /volume1/Web/test/index.php

Moderator: Lillian.W@AST

Post Reply
michpl
Posts: 10
youtube meble na wymiar Warszawa
Joined: Sat Jun 27, 2020 6:04 am

Lag in browser after editing script eg in /volume1/Web/test/index.php

Post by michpl »

Hello,
suppose I have simple script in /volume1/Web/test/index.php

Code: Select all

<?php
echo "a";
?>
after editing it via smb to:

Code: Select all

<?php
echo "aa";
?>
I can see effects on http(s)://nas/test after about 30-35 secs.

I have checked via ssh if the file is changed instanly and it is. It happens both via http and https.
Adding http(s)://nas/test?123 (to ommit browser cache) does not help.

Page developement is really hard with such lag.

Any help / ideas how to fix this appreciated. I have never seen such behaviour.
Thank you.

edit: v3.5.7.RKU2
User avatar
orion
Posts: 3482
Joined: Wed May 29, 2013 11:09 am

Re: Lag in browser after editing script eg in /volume1/Web/test/index.php

Post by orion »

If you use Chrome, "Ctrl+F5" (Windows) should force Chrome to pull in new data and ignore the cache data. (Cmd+Shift+R on a Mac)
michpl
Posts: 10
Joined: Sat Jun 27, 2020 6:04 am

Re: Lag in browser after editing script eg in /volume1/Web/test/index.php

Post by michpl »

Unfortunately it is not that simple. "Ctrl+F5" is not the solution.

I can run this page in a browser that is started right after making change in "index.php" and I have same behaviour. Browser displays "a" (!?) not "aa".
It means that it fetches old content from server. It is "cached" outside the browser, on a server side for about 30 sec.
I have never seen such behaviour.

I run default http server with no extra config at my asustor

Edit: just checked another way: after change in "index.php"

Code: Select all

wget http://localhost/test
via ssh return "a" not "aa".
So even wget return old version
User avatar
Nazar78
Posts: 2002
Joined: Wed Jul 17, 2019 10:21 pm
Location: Singapore
Contact:

Re: Lag in browser after editing script eg in /volume1/Web/test/index.php

Post by Nazar78 »

Flush or turn off opcache for development.
AS5304T - 16GB DDR4 - ADM-OS modded on 2GB RAM
Internal:
- 4x10TB Toshiba RAID10 Ext4-Journal=Off
External 5 Bay USB3:
- 4x2TB Seagate modded RAID0 Btrfs-Compression
- 480GB Intel SSD for modded dm-cache (initramfs auto update patch) and Apps

When posting, consider checking the box "Notify me when a reply is posted" to get faster response
User avatar
orion
Posts: 3482
Joined: Wed May 29, 2013 11:09 am

Re: Lag in browser after editing script eg in /volume1/Web/test/index.php

Post by orion »

Yes, call opcache_reset() when you are in development.

Code: Select all

<?php
echo "aa";
opcache_reset();
?>
Note: the next PHP request after opcache_reset should populate the cache again.
michpl
Posts: 10
Joined: Sat Jun 27, 2020 6:04 am

Re: Lag in browser after editing script eg in /volume1/Web/test/index.php

Post by michpl »

Thank you.
That solved my problem.
Post Reply

Return to “[Official] For AS10XX Series”