Author Topic: and again : refresh  (Read 739 times)

0 Members and 1 Guest are viewing this topic.

Offline zmarfak

  • Contributor
  • ***
  • Posts: 135
    • Matar
and again : refresh
« on: May 24, 2020, 04:23:00 PM »
Hi,
I have a webpage with graphs coming from Meteobridge , the html page is embedded in an iframe.
Problem is that I don't see the "actual" data.
Refresh does (F5 in Firefox) not help.
I have to do a Ctrl+F5 (clear cache in Firefox) to display the data.
Is there a way to see the "actual" data without clearing the cache ?

page : https://www.matar.be/weather/wxmbdaily.php

Thanks for any ideas.
 
Patrick
Davis Vantage Pro2 with a Meteobridge NANO SD and WL (6.04) on a Intel NUC 
https://www.matar.be

Offline the beteljuice

  • the beteljuice
  • Forecaster
  • *****
  • Posts: 316
    • test site
Re: and again : refresh
« Reply #1 on: May 24, 2020, 05:53:07 PM »
Two things you can try.

1/ In your main page modify the 'refresh' code
Code: [Select]
<script type="text/javascript">
        function refreshIFrame() {
            var x = document.getElementById("graph");
//            x.contentWindow.location.reload();
x.src += ' ';
            var t = setTimeout(refreshIFrame, 300000);
        }
    </script>

2/ Add in the graph page header
Code: [Select]
<meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate">
<meta http-equiv="Expires" content="0">
Imagine what you will KNOW tomorrow !

Offline ConligWX

  • Forecaster
  • *****
  • Posts: 843
  • #conligwx
    • conligwx.org
Re: and again : refresh
« Reply #2 on: May 24, 2020, 06:35:58 PM »
Browsers do tend to cache file yes, but your webserver may also do this if it uses Zend OpCache in php.

if you  edit your php.ini file there is an entry called:

opcache.blacklist_filename=xxx.txt

create a blacklist text file somewhere on your webserver. Add pathname/filename to the text file. this allows you to tell opcache to not cache then files.
Regards Simon
Davis Vantage Pro2 Plus (6162UK) • Daytime FARS • WeatherLink Live • AirLink • PurpleAir PA-II-SD • CumulusMX •


Offline zmarfak

  • Contributor
  • ***
  • Posts: 135
    • Matar
Re: and again : refresh
« Reply #3 on: May 25, 2020, 07:27:56 AM »
Thank you both for your input.

@the beteljuice
I have changed it, on first sight, it does not help  :sad:

@ConligWX
The Zend OPcache is indeed activate on the site (see attachments)
Unfortunate I cannot acces it, it's not available in the Plesk portal on provided by my hoster.
Patrick
Davis Vantage Pro2 with a Meteobridge NANO SD and WL (6.04) on a Intel NUC 
https://www.matar.be

Offline wvdkuil

  • Wim van der kuil
  • Forecaster
  • *****
  • Posts: 1986
    • My PWS at Leuven Belgium Europe
Re: and again : refresh
« Reply #4 on: May 25, 2020, 07:47:58 AM »
This is the link to the graph in an iFrame
Code: [Select]
<iframe id="graph" height="750" width="640px" src="https://www.matar.be/weather/day/daily_graph.html"
style="border: 1px solid #3173B1;"> </iframe>

If it is a php page you are calling this frame you could add a '?t='.time()  to the .html
Next time the page is loaded the value of time() will be different so it seems another src for the browser

Or use a small PHP script, lets name it daily_graph.php, put it in the same folder as the daily_graph.html
Code: [Select]
<?php include 'daily_graph.html'?>
And change the iFrame code to
Code: [Select]
<iframe id="graph" height="750" width="640px" src="https://www.matar.be/weather/day/daily_graph.php"
style="border: 1px solid #3173B1;"> </iframe>
That will do the trick (most of the times).

Wim
 
« Last Edit: May 25, 2020, 07:50:49 AM by wvdkuil »

Offline the beteljuice

  • the beteljuice
  • Forecaster
  • *****
  • Posts: 316
    • test site
Re: and again : refresh
« Reply #5 on: May 25, 2020, 09:20:13 AM »
Javascript appears to be 'broken' on your site  :shock:

If you look at that or the home page nothing is being updated after the initial page load. (check the time / date stamp - it never changes)
Imagine what you will KNOW tomorrow !

Offline zmarfak

  • Contributor
  • ***
  • Posts: 135
    • Matar
Re: and again : refresh
« Reply #6 on: May 25, 2020, 10:19:22 AM »
Wim,
I used your second suggestion and it works.

Thank you
Patrick
Davis Vantage Pro2 with a Meteobridge NANO SD and WL (6.04) on a Intel NUC 
https://www.matar.be

Offline zmarfak

  • Contributor
  • ***
  • Posts: 135
    • Matar
Re: and again : refresh
« Reply #7 on: May 25, 2020, 10:33:23 AM »
Javascript appears to be 'broken' on your site  :shock:
If you look at that or the home page nothing is being updated after the initial page load. (check the time / date stamp - it never changes)

Do you mean this setting as described on Ken's page, because it's commented out in my case :

$SITE['ajaxScript'] = 'ajaxWLwx.js';
    This setting specifies the filename of the AJAX JavaScript that will read the WeatherFlash WLrealtime.txt file and update your pages with new data.
    Comment out this setting (by placing either # or // in the front of this line) if you do not want AJAX updates active on your website pages.
Patrick
Davis Vantage Pro2 with a Meteobridge NANO SD and WL (6.04) on a Intel NUC 
https://www.matar.be

Offline the beteljuice

  • the beteljuice
  • Forecaster
  • *****
  • Posts: 316
    • test site
Re: and again : refresh
« Reply #8 on: May 25, 2020, 10:44:10 AM »
... That explains it !
Imagine what you will KNOW tomorrow !