0

I have a little HTML5 application that is called from an iframe of another website. The application has to be periodically updated, but because of some browser caching issue, we prefer to change the folder in order to prevent problems: www.mysite/tools/01/load.php and then 02, 03 etc.

We have no control over the iframe, so the address of the application should remain the same: let's say www.mysite/tools/index.php; the problem is that if in the index.php I use include (./01/load.php), the application doesn't work because it searches for files and subfolders inside /tools (where is index.php) and not into tools/01/ (where there are load.php and other files and subfolders).

Currently inside index.php I'm using a php redirect to ./01/load.php , but it slows a bit the access. Any idea on how to fix this issue without using the redirect? Thank you!

Andrea
  • 1
  • 2
    _"We have no control over the iframe, so the address of the application should remain the same"_ - If you keep the URL the same for the iframes, then the cache problem would be the same. Browsers cache pages based on URL, so regardless what happens on your side (what path your includes use) are irrelevant. That's not visible for the browsers in any way. Unless you need the browsers to cache your data, you can [tell them not to cache the page instead](https://stackoverflow.com/questions/13640109/how-to-prevent-browser-cache-for-php-site), or set a short timeout for the cache. – M. Eriksson Feb 03 '22 at 10:08
  • Please provide enough code so others can better understand or reproduce the problem. – Community Feb 13 '22 at 12:51

0 Answers0