Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mod_cache Settings break CSS #10241

Closed
gmariani opened this issue Jun 16, 2016 · 1 comment
Closed

mod_cache Settings break CSS #10241

gmariani opened this issue Jun 16, 2016 · 1 comment
Labels
answered For when a question was asked and we referred to forum or answered it.

Comments

@gmariani
Copy link

I have mod_cache setup on a server that servers WordPress sites. But in certain circumstances, the getCss file is cached as text/html and served as such instead of text/css. This causes the CSS not to load. Is there a proper setting for mod_cache to avoid this? Below is my mod_cache config:

#600 = 10 minutes # default 3600 (one hour) CacheDefaultExpire 600
# Enable the X-Cache-Detail header
CacheDetailHeader on

# Don't cache WordPress admin
CacheDisable /wp-admin

# Cache all but forward proxy url's (normal or quick handler)
CacheEnable disk /

# Add a header to show if it was served from cache
CacheHeader on

# Ignore no-cache commands
# CacheIgnoreCacheControl On

# Do not store Set-Cookie headers with the cache or you'll get session poisoning
CacheIgnoreHeaders Set-Cookie

# With CacheIgnoreNoLastMod On set, we don't need to define expires headers
# for the pages to be cached by the server. And we don't want to because we'll
# want to control the cache on the server. We don't want browsers to cache.
CacheIgnoreNoLastMod On

# The CacheIgnoreQueryString directive tells the cache to cache requests even if no 
# expiration time is specified, and to reply with a cached reply even if the query 
# string differs.
# CacheIgnoreQueryString On

# CacheIgnoreURLSessionIdentifiers

# CacheKeyBaseURL

# If no expiry date is set, calculate one based on last modified
# expiry-period = time-since-last-modified-date * factor
# expiry-date = current-date + expiry-period
# default 0.1
CacheLastModifiedFactor 0.5

# Enable cache lock
# CacheLock on

# CacheLockMaxAge
# CacheLockPath
# CacheMaxExpire
# CacheMinExpire

# If there is content in your cache that normally requires authentication or access 
# control, it will be accessible to anyone without authentication if the 
# CacheQuickHandler is set to “on”
CacheQuickHandler off

# Serve stale data on error.
# CacheStaleOnError on

# CacheStoreExpired
# CacheStoreNoStore
# CacheStorePrivate

<IfModule mod_cache_disk.c>
    # Sets the number of characters for each subdirectory name in the cache hierarchy
    CacheDirLength 1

    # Use CacheDirLength=2 and CacheDirLevels=1 to ensure htcacheclean will not take forever 
    # when cleaning up your cache directory.
    CacheDirLevels 2

    # The maximum size (in bytes) of a document to be placed in the cache
    # CacheMaxFileSize 1000000

    # The minimum size (in bytes) of a document to be placed in the cache
    # CacheMinFileSize 1

    # The minimum size (in bytes) of the document to read and be cached before sending the data downstream
    # CacheReadSize 0

    # The minimum time (in milliseconds) that should elapse while reading before data is sent downstream
    # CacheReadTime 0

    # The directory root under which cache files are stored
    # Be sure to set ownership of this file to the 'nobody' user or no files will 
    # be written to it
    CacheRoot   "/var/cache/apache/"
</IfModule>
@tsteur
Copy link
Member

tsteur commented Jun 17, 2016

Hi @gmariani Please ask this question in our forum http://forum.piwik.org/

@tsteur tsteur closed this as completed Jun 17, 2016
@tsteur tsteur added the answered For when a question was asked and we referred to forum or answered it. label Jun 17, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
answered For when a question was asked and we referred to forum or answered it.
Projects
None yet
Development

No branches or pull requests

2 participants