View Issue Details

IDProjectCategoryView StatusLast Update
0005586OXID eShop (all versions)4.08. Cachepublic2014-04-10 15:25
Reporterarvydas_vapsva Assigned To 
PriorityhighSeveritymajorReproducibilityalways
Status closedResolutionduplicate 
Product Version4.8.1 / 5.1.1 
Target Version4.8.5 / 5.1.5 
Summary0005586: Varnish config overrides expiration headers, defined in .htaccess
DescriptionFollowing lines override custom expiration headers, defined in ".htaccess", thus you cannot force browser to cache locally:

set resp.http.Cache-Control = "no-cache, no-store, must-revalidate, proxy-revalidate";
set resp.http.Pragma = "no-cache";
set resp.http.Expires = "Tue, 01 Jan 1985 00:00:00 GMT";
Tagshtaccess, Varnish
ThemeBoth
BrowserAll
PHP Versionany
Database Versionany

Relationships

duplicate of 0005334 resolvedmantas.vaitkunas Varnish config disables browser cache for CSS/JS/IMG 

Activities

saulius.stasiukaitis

2014-02-14 13:19

reporter   ~0009504

This functionality was introduce to ensure that no other proxies stand in between and change caching rules. As Shop makes sure that cache in Varnish are correct by invalidating it on fact not on defined time.

Possible workaround would be to remove those lines, as this functionality do not change shop behavior directly.

More correct workaround would be to check what file type is requested and do not add additional headers on images and css.
Code would look somehow like this:

    if (req.url !~ "\.(jpg|jpeg|png|gif|bmp|gz|tgz|bz2|tbz|mp3|ogg|(js|css)(\?[0-9]+)?)$") {
        set resp.http.Cache-Control = "no-cache, no-store, must-revalidate, proxy-revalidate";
        set resp.http.Pragma = "no-cache";
        set resp.http.Expires = "Tue, 01 Jan 1985 00:00:00 GMT";
    }