Napisany przez: matti9410 9.04.2023, 11:14:59
Cześć,
Mam problem z odświeżaniem plików docx na serwerze.
Problem wygląda następująco. Używam biblioteki "PhpWord" do generowania plików docx. W bibliotece wskazuję szablon dokumentu docx na którym biblioteka ma pracować.
W momencie wgrania nowego szablonu biblioteka/serwer/przeglądarka (nie potrafię określić) zapamiętuje poprzedni szablon i wykonuje działanie do starego pliku szablonowego.
Sytuacja się naprawia, gdy ręcznie czyszczę pamięć podręczną przeglądarki. Wtedy skrypt wykonuje się do nowego szablonu docx.
W jaki sposób mogę wymusić brak zapisu plików docx w pamięci podręcznej przeglądarki?
Wiem, że takie rzeczy można ustawić w pliku ".htaccess".
Plik znajduje się w głównym folderze "pubilic_html" strony
Poproszę o pomoc w tym temacie. Jeżeli temat utworzyłem w złym dziale proszę o przeniesienie.
Kod
# MIME TYPES
<IfModule mod_mime.c>
# DEFAULTS
DefaultLanguage en
AddLanguage en-US .html .css .js
AddCharset utf-8 .html .css .js .xml .json .rss .atom
# JAVASCRIPT
AddType application/javascript js jsonp
AddType application/json json
# FONTS
AddType font/opentype otf
AddType application/font-woff woff
AddType application/font-woff2 woff2
AddType application/x-font-woff woff
AddType application/x-font-woff2 woff2
AddType application/vnd.ms-fontobject eot
AddType application/x-font-ttf ttc ttf
AddType image/svg+xml svg svgz
AddEncoding gzip svgz
# AUDIO
AddType audio/mp4 m4a f4a f4b
AddType audio/ogg oga ogg
# VIDEO
AddType video/mp4 mp4 m4v f4v f4p
AddType video/ogg ogv
AddType video/webm webm
AddType video/x-flv flv
# OTHERS
AddType application/octet-stream safariextz
AddType application/x-chrome-extension crx
AddType application/x-opera-extension oex
AddType application/x-shockwave-flash swf
AddType application/x-web-app-manifest+json webapp
AddType application/x-xpinstall xpi
AddType application/xml atom rdf rss xml
AddType application/vnd.openxmlformats .docx .pptx .xlsx .xltx . xltm .dotx .potx .ppsx
AddType text/cache-manifest appcache manifest
AddType text/vtt vtt
AddType text/x-component htc
AddType text/x-vcard vcf
AddType image/webp webp
AddType image/x-icon ico
</IfModule>
## EXPIRES HEADER CACHING ##
<IfModule mod_expires.c>
ExpiresActive On
ExpiresDefault "access 1 year"
# CSS
ExpiresByType text/css "access plus 1 year"
# Data interchange
ExpiresByType application/atom+xml "access plus 1 hour"
ExpiresByType application/rdf+xml "access plus 1 hour"
ExpiresByType application/rss+xml "access plus 1 hour"
ExpiresByType application/json "access plus 0 seconds"
ExpiresByType application/ld+json "access plus 0 seconds"
ExpiresByType application/schema+json "access plus 0 seconds"
ExpiresByType application/vnd.geo+json "access plus 0 seconds"
ExpiresByType application/xml "access plus 0 seconds"
ExpiresByType text/xml "access plus 0 seconds"
# Favicon (cannot be renamed!) and cursor images
ExpiresByType image/vnd.microsoft.icon "access plus 6 month"
ExpiresByType image/x-icon "access plus 6 month"
# HTML
ExpiresByType text/html "access plus 0 seconds"
# JavaScript
ExpiresByType application/javascript "access plus 1 year"
ExpiresByType application/x-javascript "access plus 1 year"
ExpiresByType text/javascript "access plus 1 year"
# Manifest files
ExpiresByType application/manifest+json "access plus 1 year"
ExpiresByType application/x-web-app-manifest+json "access plus 0 seconds"
ExpiresByType text/cache-manifest "access plus 0 seconds"
ExpiresByType application/vnd.openxmlformats-officedocument.wordprocessingml.document "access plus 0 seconds"
# Media files
ExpiresByType audio/ogg "access plus 6 month"
ExpiresByType image/bmp "access plus 6 month"
ExpiresByType image/gif "access plus 6 month"
ExpiresByType image/jpeg "access plus 6 month"
ExpiresByType image/png "access plus 6 month"
ExpiresByType image/svg+xml "access plus 6 month"
ExpiresByType image/webp "access plus 6 month"
ExpiresByType video/mp4 "access plus 6 month"
ExpiresByType video/ogg "access plus 6 month"
ExpiresByType video/webm "access plus 6 month"
# Web fonts
# Embedded OpenType (EOT)
ExpiresByType application/vnd.ms-fontobject "access plus 1 month"
ExpiresByType font/eot "access plus 1 month"
# OpenType
ExpiresByType font/opentype "access plus 1 year"
# TrueType
ExpiresByType application/x-font-ttf "access plus 1 year"
# Web Open Font Format (WOFF) 1.0
ExpiresByType application/font-woff "access plus 1 year"
ExpiresByType application/x-font-woff "access plus 1 year"
ExpiresByType font/woff "access plus 1 year"
# Web Open Font Format (WOFF) 2.0
ExpiresByType application/font-woff2 "access plus 1 year"
ExpiresByType application/x-font-woff2 "access plus 1 year"
ExpiresByType font/woff2 "access plus 1 year"
# Other
ExpiresByType text/x-cross-domain-policy "access plus 0 seconds"
</IfModule>