Until yesterday, my Hugo was v0.128.2. My Hugo uses the resources.GetRemote function to read external JSON files to build the site’s pages. The cache settings are as follows in hugo.toml
[caches]
[caches.getresource]
dir = ':resourceDir/_gen'
maxAge = -1
I noticed that the cache has not been generated for a while now.
Thank you very much for your reply. I git cloned the Hugo site you created to my computer. I confirmed that the cache is indeed generated.
So, I tried several cases. As a result, I found that the phenomenon is occurring for a specific API that I access.
In other words, when accessing that API and reading a JSON file, Hugo v0.126.3 generates a cache, but Hugo v0.128.2 does not seem to generate a cache. The above git cloned Hugo site also behaves like that.
This API, however, requires member registration and acquisition of an app ID in order to access it. Therefore, I cannot let you try it out and check it.
Note that nothing has changed in the specifications of the API in question during this period.
I am not sure what to do, but I may have to use Hugo v0.126.3 for the time being. If any ideas, please let me know. Thank you.
Additional Notes. I accessed the API in question and read the JSON file, then, I opened and checked the cache generated by Hugo v0.126.3. At the beginning of the file was the following,
Is the “Cache-Control: no-store” in line 4 the key point? I may be misunderstanding, but Hugo v0.128.2 strictly supports “no-store”, and Hugo v0.126.3 does not?
However, the help web page for this API states that caching is allowed.
I have thought again. For the future, I will upgrade Hugo to the latest version, and will consider some other approach for the API and Cache. Thank you very much.