Server caching

Overzicht Reageren

Sponsored by: Vacatures door Monsterboard

Eschwin Moerkerken

Eschwin Moerkerken

11/09/2014 09:17:28
Quote Anchor link
Hallo,

Ik ben bezig met een website en heb deze gehost bij Strato.
Nu heb ik een probleem dat als ik een nieuwe afbeelding naar de server upload hij op de website telkens de oude pakt terwijl de nieuwe toch wel degelijk op de server staat na een paar controles.

Mijn vraag is kun je deze server 'cache' uitzetten en hoe ?

Ik heb gelezen dat je dit kunt veranderen in de php.ini maar nu is het probleem zo dat ik deze niet eens heb. Ook heb ik gelezen dat je dit kunt aanpassen in je htaccess maar zou niet weten hoe dat dan zou moeten.

Dit probleem is erg frustrerend dus ik hoop dat iemand mij hiermee kan helpen en een zetje in de goede richting kan geven.

Alvast bedankt !


edit: ik heb nu dit aangepast, maar er gebeurd niets op mijn website. De website haalt nog steeds niet de nieuwe afbeeldingen op van de server.
Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
<IfModule mod_expires.c>

    ExpiresActive on
    ExpiresDefault                                      "access plus 1 month"

  # CSS
    ExpiresByType text/css                              "access plus 1 year"

  # Data interchange
    ExpiresByType application/json                      "access plus 0 seconds"
    ExpiresByType application/ld+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/x-icon                          "access plus 0 seconds" <--

  # HTML components (HTCs)
    ExpiresByType text/x-component                      "access plus 1 month"

  # HTML
    ExpiresByType text/html                             "access plus 0 seconds"

  # JavaScript
    ExpiresByType application/javascript                "access plus 1 year"

  # Manifest files
    ExpiresByType application/x-web-app-manifest+json   "access plus 0 seconds"
    ExpiresByType text/cache-manifest                   "access plus 0 seconds"

  # Media
    ExpiresByType audio/ogg                             "access plus 0 seconds" <--
    ExpiresByType image/gif                             "access plus 0 seconds" <--
    ExpiresByType image/jpeg                            "access plus 0 seconds" <--
    ExpiresByType image/png                             "access plus 0 seconds" <--
    ExpiresByType video/mp4                             "access plus 0 seconds" <--
    ExpiresByType video/ogg                             "access plus 0 seconds" <--
    ExpiresByType video/webm                            "access plus 0 seconds" <--

  # Web feeds
    ExpiresByType application/atom+xml                  "access plus 1 hour"
    ExpiresByType application/rss+xml                   "access plus 1 hour"

  # Web fonts
    ExpiresByType application/font-woff                 "access plus 1 month"
    ExpiresByType application/vnd.ms-fontobject         "access plus 1 month"
    ExpiresByType application/x-font-ttf                "access plus 1 month"
    ExpiresByType font/opentype                         "access plus 1 month"
    ExpiresByType image/svg+xml                         "access plus 1 month"

</IfModule>


Waar <-- achter staat heb ik veranderd naar 0 seconden
Gewijzigd op 11/09/2014 09:43:34 door Eschwin Moerkerken
 
Er zijn nog geen reacties op dit bericht.



Overzicht Reageren

 
 

Om de gebruiksvriendelijkheid van onze website en diensten te optimaliseren maken wij gebruik van cookies. Deze cookies gebruiken wij voor functionaliteiten, analytische gegevens en marketing doeleinden. U vindt meer informatie in onze privacy statement.