K
K
kreativ_252018-12-17 09:19:43
caching
kreativ_25, 2018-12-17 09:19:43

Chart js caches the site - what to do?

Good afternoon!
I am developing a project in php.
Needed graphical visualization.
Added a Chart JS chart to the project.
The data in the graph is selected from the MySQL database.
So, after adding this graph, the site began to cache wildly.
It got to the point that you completely delete the chart code from the project - save the project - completely close the browser.
You open - you refresh the page, and on it, as there was a schedule, it remained.
The only thing that helps is a complete clearing of the history while working with the site.
If someone faced a similar problem - what did you do ???
Or what can be done to prevent this from happening?
Where to dig?

Answer the question

In order to leave comments, you need to log in

4 answer(s)
P
Petr Vasiliev, 2018-12-17
@danial72

For debugging in chrome ctrl shift r clearing the cache with extreme cruelty.
For production, set up a server. Htacess no cache on certain paths.

L
lamer350, 2018-12-17
@lamer350

The problem is clearly something else, Chart JS has nothing to do with it. Look for a problem on the server.

S
Stanislav Shendakov, 2018-12-17
@shindax

Try to include chart.js with simulated GET request:

...
<script type="text/javascript" src="/js/chart.js?val=0"></script>
...
<?php
...

This is how we fight users who don't know what ctrl-shift-r is. :) Uv. lamer350 is not entirely right, in addition to the server, the Javascript code may well be involved in the cache.

T
ThunderCat, 2018-12-17
@ThunderCat

If someone faced a similar problem - what did you do ???

I was looking for the root of the problem, namely, at the first stage, we look at what physically comes from the server through the chromium devtools, if the data comes from the server, we dig towards the server cache / cookies, otherwise we look at what resources are pulled from the browser cache, set the lifetime for the corresponding objects.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question