Answer the question
In order to leave comments, you need to log in
How to properly use the browser cache?
Hello everyone ...
How to work with the browser cache?
There are various options, somewhere I saw a time limit for each loaded element, and somewhere in htaccess, well, how would it be more correct to implement all this?
For example, for js / html / css files, set the cache for a month
and for images for several hours
And some images do not need a cache at all
I would be very grateful for advice
Answer the question
In order to leave comments, you need to log in
The browser will cache or not cache the files you specify in the headers. You specify them using php or htaccess - it doesn't matter. It is important to set them in the most convenient way for you based on the task at hand.
Need to dynamically change caching times and file types?
Use sending headers from php using the headers(); function.
Do you need static rules that will change infrequently?
Use the rules for htaccess:
habrahabr.ru/sandbox/55709
This is how we can check the headers
highloadtools.com/cachecontrol
Maybe you forgot the quotes?$pr_fname = filter_input(INPUT_POST, 'pr_fname');
post'om and so super global variables walk.
they do not need to be passed as an argument.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question