How to avoid cache on header top bar, widgets (date and weather/temperature)

Posted in: Newspaper
Post count: 312

How to avoid cache on header top bar, widgets (date and weather/temperature) ?

I mean I have to clear cache everyday to update date and weather/temperature…

What I have to do to avoid it ?

Post count: 18283

Hello !

Please try a cache plugin. We recommend using the WP Super Cache: https://forum.tagdiv.com/cache-plugin-install-and-configure/

Thank you !

Post count: 312

I already use wp super cache, but problem is still here

Post count: 18283

Hello !

There are 4 types of cache on a website. If after installing the plugin you still experience cache problems please contact your host in this matter.

Thank you !

Post count: 312

The problem is still here, and I use the config for WP supercache, that is described on your blog

Post count: 18283

Hello !

You will have to contact your host in this matter. They can add cache to your website too. Let them know about your problem.

Thank you !

Post count: 312

My problem is still here, but only on home page. I mean the weather and date on header is updated everyday on the other pages but not on homepage why ?

Thank you

lowtechnation.com

I only use WP Super cache Autoptimize and Cloudflare

Post count: 18283

Hello !

I would personally recommend to try and disable 1 or 2 options for cache. Having 3 caching options is not the best solution since they can get in conflict and actually do nothing.

Try first by disabling the wp super cache. And re-check.

Thank you !

Post count: 312

Doesn’t work

Post count: 35449

Hi gumball44, make sure that you are using only one header for the entire website and you do not have set individual headers set on pages or cloud templates.
Also like Vlad said please check only with one cache plugin per day to see if there are some changes, using more the one cache plugin can cache more then you want and it will be hard to clear all that cache.
Another thing that you can do is to use a code or plugin to prevent that homepage to be cache.
Thank you!

Post count: 62

We have been trying to resolve this same issue for awhile now. Turning off cache on the home page is not an option since it’s the most trafficked of all pages. We are only using one cache plugin. However most of them offer an ability to exclude or exclude deferring the loading of certain JavaScript files or code.

Wondering if you could help us identify which code or call is being made to deliver the current temperature? Should we focus on the http://api.openweathermap.org/data/2.5/forecast?id=524901&APPID={YOUR API KEY} API? Hopefully excluding only that element from the cache process would solve the problem? Any other ideas or feedback would be appreciated. Thanks!

Post count: 35449

Hi,

The code use to display the temperature is on two files:
wp-content/plugins/td-composer/legacy/common/wp_booster/td_weather.php -> https://i.imgur.com/rGf75ya.png
and this is use on this file too
wp-content/plugins/td-cloud-library/shortcodes/header/tdb_header_weather.php -> https://i.imgur.com/ZM6kwOx.png
The above code is use to display the temperature
On this file are set some links to that api -> wp-content/plugins/td-composer/legacy/common/wp_booster/td_weather.php -> https://i.imgur.com/db8VkY4.png -> https://i.imgur.com/s2uk7GT.png
Also the links for the http://api.openweathermap.org are set in the minify js -> wp-content/plugins/td-composer/legacy/Newspaper/js/tagdiv_theme.min.js -> https://i.imgur.com/AnY34U8.png

This is all I can do, unfortunately I do not know any method to disable the cache on some elements, sorry!

Thank you!

Post count: 312

The issue is not only with the weather widget, the issue is here too with date widget.. I now have a header without weather widget but date doesn’t update… Still have this cache issue.

Post count: 35449

Hi,

What cache plugins are you using, did you try only with the one that we recommend ?
If you tried and the problem persists, we can take a look send us an email at contact@tagdiv.com and provide login credentials.

Thank you!

Post count: 312

I use WP Super Cache Autoptimize and Cloudflare

Here find the code in my htaccess. file, <IfModule mod_deflate.c>
<filesMatch "\.(js|css|html|php)$">
SetOutputFilter DEFLATE
</filesMatch>
</IfModule>

# BEGIN Expire headers
<ifModule mod_expires.c>
ExpiresActive On
ExpiresDefault "access plus 5 seconds"
ExpiresByType image/x-icon "access plus 604800 seconds"
ExpiresByType image/jpeg "access plus 604800 seconds"
ExpiresByType image/png "access plus 604800 seconds"
ExpiresByType image/gif "access plus 604800 seconds"
ExpiresByType application/x-shockwave-flash "access plus 604800 seconds"
ExpiresByType text/css "access plus 604800 seconds"
ExpiresByType text/javascript "access plus 604800 seconds"
ExpiresByType application/javascript "access plus 604800 seconds"
ExpiresByType application/x-javascript "access plus 604800 seconds"
ExpiresByType application/x-font-woff "access plus 604800 seconds"
ExpiresByType application/x-font-svg "access plus 604800 seconds"
ExpiresByType image/svg+xml "access plus 604800 seconds"
</ifModule>
# END Expire headers

<filesmatch ".(ico|pdf|flv|jpg|jpeg|png|gif|js|css)$">
Header set Cache-Control "max-age=2628000, public"
</filesmatch>

# Éviter que l'on découvre l'identifiant d'un auteur
<IfModule mod_rewrite.c>
RewriteCond %{QUERY_STRING} ^author=([0-9]*)
RewriteRule .* - [F]
</IfModule>
# BEGIN ShortPixelWebp
# Les directives (lignes) entre « BEGIN ShortPixelWebp » et « END ShortPixelWebp » sont générées
# dynamiquement, et doivent être modifiées uniquement via les filtres WordPress.
# Toute modification des directives situées entre ces marqueurs sera surchargée.

<IfModule mod_rewrite.c>
RewriteEngine On

Is one of these codes making troubles with weather widget ?

Thank you

Post count: 35449

Hi,

I can not say for sure if there are or not some elements that can affect the weather widget, the only way to know this is if you check it, remove the code and check the results. Is possible that some js code to be cache and to provide this problem.

Thank you!

Post count: 312

The issue is only with home page and categories.

widget weather on Post pages is updated everyday..

So what’s the issue ?

  • This reply was modified 5 years by gumball44.
Post count: 35449

Hi gumball44, I think that this query we can handle only if we have access to investigate the website, only in this way we can see if thee are some settings or something that can interfere with the theme options and cache those elements on homepage and categories.
If you want can send us an email at contact@tagdiv.com and provide admin login and cPanel, also make first a full backup to your website and database. We will take a look. Include a link to this topic in the email.

Thank you for your understanding!

Viewing 18 posts - 1 through 18 (of 18 total)
The forum ‘Newspaper’ is closed to new topics and replies.