Developer forum

Forum » Feature requests » Deleting the cache files for a page, when the caching timestamp expires

Deleting the cache files for a page, when the caching timestamp expires

Jacob Bertelsen
Reply

Hi DW,

If I use "Entire page - 5 min" caching, the caching of a page some times does not expire and renew, when the 5 minutes are gone. This is a problem with discounts, active products that have been made inactive, and so forth.
Deleting the "Page74.html"-file in the cache.net-folder clears this problem, and seems to force a new request from the DB.

I notice that the "Page74.html"-file in the cache.net-folder, representing the caching of PageID=74, does not get deleted when the 5 minute timestamp should expire.

Is this a bug, or is it by design?
From my chair, I would prefer if a given cache file was deleted when the 5 minute caching expired :) .


Replies

 
Nicolai Høeg Pedersen
Reply

You cannot use full page cache for product lists where prices and discounts are in use.

The files is not deleted. In the top of the file there is a timestamp - when that gets older than 5 mins, it will generate a new file. It will never delete.

BR Nicolai

 
Jacob Bertelsen
Reply

Full page caching seems to work fine with prices and discounts, when I delete the cache files :) .

This might be a simplification, but:
Since deleting the cache files, makes full page caching work with prices and discounts, in my mind this is a nice way of fixing full page caching of product lists with prices and discounts.

A workaround for this would be that we custom code a cache buster, that looks at the "Date modified"-timestamp, and deletes the .html-file when this occurs.

If the .html-files in the cache.net-folder are "only" used to serve entire page caching, and deleting the file solves the issue of prices and discounts, I would, however, prefer to use default Dynamicweb functionality, instead of custom coding our way out of it :) .

 
Nicolai Høeg Pedersen
Reply

Trust me when I say that is not the case. I wrote the code myself, and if you use fullpage caching on pages with discounts, it will not work. It will cache the output of one user and display it to another user. So if one user is eligable for a discount and another user is not, prices will fuck up.

So unless you have made some magic your self...

(be aware that if you are logged into the backend, you will not get the cached output)

BR Nicolai

 
Jacob Bertelsen
Reply

Hi Nicolai,

Thanks for the answers :) .

I can see it would be useless to delete the files, if there were login functionality on the frontend part of the website.
This website I am working on, however, has no frontend login functionality.

Is it understood correctly, that deleting the .html-files will fetch fresh product information and discount information for these products, as long as there is no frontend login?

 
Jacob Bertelsen
Reply

Using the new search with repositories, I have to re-index the search files before deleting the cache files.
Other than that, I believe it should work as I want it to.

 
Nicolai Høeg Pedersen
Reply
This post has been marked as an answer

Yes, that is correct. But do not use full page caching. Please.

Votes for this answer: 1
 
Jacob Bertelsen
Reply

Alright, I will look into other options than full page caching.

Thanks for swift answers :)