E
E
enchikiben2015-06-21 22:21:16
JavaScript
enchikiben, 2015-06-21 22:21:16

How not to cache images with a certain name?

Good evening!
For caching statics, I used standard headers in htaccess:

<FilesMatch "\.(flv|swf|ico|gif|jpg|jpeg|png)$">
   Header set Cache-Control "max-age=2592000"
</FilesMatch>

tell me how not to cache files with certain names? For example: avatar.jpg

Answer the question

In order to leave comments, you need to log in

3 answer(s)
D
Dmitry Belyaev, 2018-09-21
@Redrik_Shuhart


the main problem here: https://github.com/hilios/jQuery.countdown/blob/ma...
strftime is very heavy, and you pull it for every sneeze

P
PO6OT, 2015-06-22
@woonem

After that entry, write:

<FilesMatch "avatar.jpg">
   Header set Cache-Control "max-age=0"
</FilesMatch>

Why do you need it?
If, so that the avatar changes immediately after installation, then just give it a random name every time, and write this name into the database, then get it with a script and insert it inside your HTML. If you are too lazy to set up a connection to MySQL, you can use YNDb, just do not store important information in YNDb in any case - there is no stable version.

S
ShamblerR, 2015-06-22
@ShamblerR

Negation in modules definitely works, and it can work here.
Try it, it might work
or alternatively write an
exception for images with a ban under the current FilesMatch

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question