Answer the question
In order to leave comments, you need to log in
How to prevent Symfony from caching a specific file?
I need to exclude a file from the cache that needs to be updated very often. How to make sure that it never gets cached at all?
Updated: Generation is done by a command on the server, via cron (or manually), then the data is written to a local file, and then issued to the user when he enters the "export" routing.
It is desirable to remove both the file and the command and the controller that issues the file from caching, but the primer is enough for me. I did not find anything sensible on en_US sites.
Updated: I have an export.xml file on the server, which is filled with some amount of data with each command. There is a third-party server that accepts this file by reference. For the uniqueness of each export, there is a script on the server that issues it with the name "export_20150623093750.xml" where after "export_" there is simply "YmdHis". The problem is that after giving me such a file once, for some time the server gives me the same file with the same name, that is, it does not update it at all before downloading, but essentially gives out its cached version. The bottom line is not even in the name, but in the fact that the export file, despite the fact that I even manually update it, does not change when loaded.
Answer the question
In order to leave comments, you need to log in
Solved a problem. It was buried in nginx.
location ~* .(xml)$ {
add_header Expires -1;
log_not_found off;
}
symfony.com/doc/2.0/reference/configuration/twig.html
cache parameter isn't it?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question